Eduardo has posted comments on this change.
Change subject: Fix race in fileUtils.createdir().
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File vdsm/storage/fileUtils.py
Line 166: if not ignoreErrors and cleanupdir_errors:
Line 167: raise RuntimeError("%s %s" % (dirPath, cleanupdir_errors))
Line 168:
Line 169:
Line 170: def createdir(dirPath, mode=None):
>>> os.makedirs("/tmp/wawa")
>>> os.makedirs("/tmp/wawa")
Traceback (most recent call last):
File "<pyshell#136>", line 1, in <module>
os.makedirs("/tmp/wawa")
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/wawa'
>>> cdir.createdir("/tmp/wawa")
>>> cdir.createdir("/tmp/wawa", 0700)
Traceback (most recent call last):
File "<pyshell#138>", line 1, in <module>
cdir.createdir("/tmp/wawa", 0700)
File "/home/ewarszaw/scratch/createdir.py", line 28, in createdir
(dirPath, oct(statinfo[stat.ST_MODE]), oct(mode)))
OSError: [Errno 1] Existing /tmp/wawa dir permissions 040775 are not as
requested 0700
Line 171: """
Line 172: Recursively create directory if doesn't exist
Line 173:
Line 174: If already exists check that permissions are as requested.
--
To view, visit http://gerrit.ovirt.org/8732
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iac856c219a08fa0303e5da1d04f4f6b8e17e07a3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches