Edward Haas has posted comments on this change.
Change subject: utils: atomic file write ......................................................................
Patch Set 13: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/61482/12/lib/vdsm/utils.py File lib/vdsm/utils.py:
Line 953: if os.path.exists(filename): Line 954: shutil.copyfile(filename, tmp_filename) Line 955: with open(tmp_filename, flag) as f: Line 956: yield f Line 957: except IOError:
Changed to IOError.
But it needs to be generic... If a failure occurs, the file needs to be removed regardless of the error type. If no failure occurs, the file is moved to apply the change atomically. Line 958: rmFile(tmp_filename) Line 959: raise Line 960: else: