Change in vdsm[master]: gluster: Added gluster hooks support

tjeyasin at redhat.com tjeyasin at redhat.com
Tue Apr 23 05:42:47 UTC 2013


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 <tjeyasin at redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list