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 <[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
