Change in vdsm[master]: fileUtils: Add atomic_symlink utility

nsoffer at redhat.com nsoffer at redhat.com
Sat Mar 12 01:05:20 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: fileUtils: Add atomic_symlink utility
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/53680/1/vdsm/storage/fileUtils.py
File vdsm/storage/fileUtils.py:

Line 220:         os.symlink(target, tmp_name)
Line 221:     except OSError as e:
Line 222:         if e.errno != errno.EEXIST:
Line 223:             raise
Line 224:         log.debug("Removing stale temporary link %r", tmp_name)
> So do you think we should use ."tmp.random_value"?
Leaving this as is, I don't want to cleanup leftovers, and code two threads trying to update the same link are unlikely.
Line 225:         os.unlink(tmp_name)
Line 226:         os.symlink(target, tmp_name)
Line 227: 
Line 228:     try:


-- 
To view, visit https://gerrit.ovirt.org/53680
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I931eca7a25c7b10344fce78b274d633d73eb082d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stirabos at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list