summaryrefslogtreecommitdiff
path: root/nova/privsep
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-12 21:35:04 +0000
committerGerrit Code Review <review@openstack.org>2019-03-12 21:35:05 +0000
commit9fa26e439b9064a64aa96d29594e26f71843db9f (patch)
tree95b83ff478946efffcde4e0a712fc6ecaa2fad90 /nova/privsep
parenta5e3054e1d6df248fc4c00b9abd7289dde160393 (diff)
parente65a5275eeecae6ab041db2f089ae5dc3eefd92c (diff)
downloadnova-9fa26e439b9064a64aa96d29594e26f71843db9f.tar.gz
Merge "Revert "Fixes race condition with privsep utime""
Diffstat (limited to 'nova/privsep')
-rw-r--r--nova/privsep/path.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/nova/privsep/path.py b/nova/privsep/path.py
index 680bce1751..c35e32ce54 100644
--- a/nova/privsep/path.py
+++ b/nova/privsep/path.py
@@ -70,10 +70,12 @@ def chmod(path, mode):
def utime(path):
if not os.path.exists(path):
raise exception.FileNotFound(file_path=path)
- # context wrapper ensures the file exists before trying to modify time
- # which fixes a race condition with NFS image caching (see LP#1809123)
- with open(path, 'a'):
- os.utime(path, None)
+
+ # NOTE(mikal): the old version of this used execute(touch, ...), which
+ # would apparently fail on shared storage when multiple instances were
+ # being launched at the same time. If we see failures here, we might need
+ # to wrap this in a try / except.
+ os.utime(path, None)
@nova.privsep.sys_admin_pctxt.entrypoint