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

avishwan at redhat.com avishwan at redhat.com
Wed Apr 10 05:13:22 UTC 2013


Aravinda VK has posted comments on this change.

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


Patch Set 18: (1 inline comment)

....................................................
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:
Create tempfile in the same directory where that file present, using dir=os.path.dirname(fileName) as parameter inside NamedTemporaryFile. 

Then use os.rename to move the file from temp file to filename as required. (shutil also not required if both file present in same fs)

Reason: 
Added the logic of tempfile so that we can recover the data if any crash/data corrupt. But Debian based systems cleans /tmp when they restart.
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 <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