Merge "In utils.tempdir, pass CONF.tempdir as an argument."

This commit is contained in:
Jenkins 2013-06-03 00:44:22 +00:00 committed by Gerrit Code Review
commit 0afcc051a9

View File

@ -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: