Antoni Segura Puimedon has posted comments on this change.
Change subject: Added utility to ensure that files written to the file system happen
atomically.
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/utils.py
Line 855: def __unicode__(self):
Line 856: return unicode(self.cmd)
Line 857:
Line 858: @contextmanager
Line 859: def atomicWrite(targetFile):
I didn't do that cause it is only for writing. I guess I could allow write and write
binary modes.
Line 860: '''Context manager that makes the write happen to a temporary
file and if
Line 861: and only it is successful, overwrites the original file. It creates the
Line 862: temporary file in the same directory of the destination file, as rename is
Line 863: only atomic within the same filesystem.'''
--
To view, visit
http://gerrit.ovirt.org/7656
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibecd61d6746231a5a8cb17bad9a3302b01454f27
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server