diff --git a/nova/utils.py b/nova/utils.py index 97551e8eb9..94c425cc19 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -920,8 +920,10 @@ def temporary_chown(path, owner_uid=None): @contextlib.contextmanager def tempdir(**kwargs): - tempfile.tempdir = CONF.tempdir - tmpdir = tempfile.mkdtemp(**kwargs) + argdict = kwargs.copy() + if 'dir' not in argdict: + argdict['dir'] = CONF.tempdir + tmpdir = tempfile.mkdtemp(**argdict) try: yield tmpdir finally: