Timothy Asir has posted comments on this change.

Change subject: gluster: Added gluster hooks support
......................................................................


Patch Set 18: (3 inline comments)

....................................................
File vdsm/gluster/hooks.py
Line 29: from . import safeWrite
Line 30: 
Line 31: _glusterHooksPath = '/var/lib/glusterd/hooks/1'
Line 32: _mimeType = magic.open(magic.MIME_TYPE)
Line 33: _mimeType.load()
Done
Line 34: 
Line 35: 
Line 36: class HookLevel:
Line 37:     PRE = 'PRE'


Line 243: @checkArgs
Line 244: @exportToSuperVdsm
Line 245: def hookRemove(glusterCmd, hookLevel, hookName):
Line 246:     hookFile = _getHookFile(glusterCmd, hookLevel.lower(), hookName)
Line 247:     try:
Gluster does not care about disabledHook during pre/post command execution. So, 
It doesn't matter, if we unable to remove disabledHook file. But we cannot 
ignore the enabledHook file remove silently. We need to notify with appropriate 
error. That's why its safe to check and remove enabledHook. However multiple 
system call execution into consideration I will go with your suggestion.
Line 248:         os.remove(hookFile)
Line 249:         return True
Line 250:     except OSError, e:
Line 251:         errMsg = "[Errno %s] %s: '%s'" % (e.errno, e.strerror, 
e.filename)


....................................................
File vdsm/gluster/__init__.py
Line 70:     return methods
Line 71: 
Line 72: 
Line 73: def safeWrite(fileName, content):
Line 74:     with tempfile.NamedTemporaryFile(delete=False) as tmp:
Done
Line 75:         tmp.write(content)
Line 76:         tmpFileName = tmp.name


--
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: 18
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

Reply via email to