Timothy Asir has posted comments on this change.
Change subject: gluster: Added gluster hooks support
......................................................................
Patch Set 23: (2 inline comments)
....................................................
File vdsm/gluster/hooks.py
Line 133: @exportToSuperVdsm
Line 134: def hookEnable(glusterCmd, hookLevel, hookName):
Line 135: enabledFile, disabledFile = _getHookFileNames(glusterCmd,
Line 136: hookLevel.lower(),
hookName)
Line 137: if os.path.exists(disabledFile):
Yes I will do it for disabledFile verfication as below:
try:
statements;
except OSError, e:
if errno == ENOENT:
if not os.path.exists(enabledFile):
raise hook_not_found_exeception
else:
raise hook_failed_exeception
Line 138: try:
Line 139: os.rename(disabledFile, enabledFile)
Line 140: st = os.stat(enabledFile)
Line 141: os.chmod(enabledFile, st.st_mode | stat.S_IEXEC)
Line 137: if os.path.exists(disabledFile):
Line 138: try:
Line 139: os.rename(disabledFile, enabledFile)
Line 140: st = os.stat(enabledFile)
Line 141: os.chmod(enabledFile, st.st_mode | stat.S_IEXEC)
It's really a good suggestion. We also thought this before. But the current
glusterfs has a limitation that, It will try to simply execute all the hook
file which starts with "S". And will raise an error when the hook file does not
have an appropriate permission. So it is required here to check the existence
of the file to avoid such errors and warning messages.
Line 142: except OSError, e:
Line 143: errMsg = "[Errno %s] %s: '%s'" % (e.errno, e.strerror,
e.filename)
Line 144: raise ge.GlusterHookEnableFailedException(err=[errMsg])
Line 145: elif not os.path.exists(enabledFile):
--
To view, visit http://gerrit.ovirt.org/9671
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3918aa035d90967f1297dc7fadcf14b6a9385c45
Gerrit-PatchSet: 23
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <[email protected]>
Gerrit-Reviewer: Aravinda VK <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Bala.FA <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Timothy Asir <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches