summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-28 17:19:11 +0000
committerGerrit Code Review <review@openstack.org>2013-01-28 17:19:11 +0000
commitf5a5ba84757a85836d78cc3d8a4f62f5ada2ac65 (patch)
tree92f1880aa28699e4070127cad9c067d6d0e1ba07 /nova/utils.py
parent18708b18a73b75dbe82583b402e9d310dd135057 (diff)
parente8386a27968f5a53f97681e7caf63b2243b7ed05 (diff)
downloadnova-f5a5ba84757a85836d78cc3d8a4f62f5ada2ac65.tar.gz
nova-f5a5ba84757a85836d78cc3d8a4f62f5ada2ac65.tar.xz
nova-f5a5ba84757a85836d78cc3d8a4f62f5ada2ac65.zip
Merge "Allow users to specify a tmp location via config"
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 97091e42c..52d4868c9 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -76,6 +76,9 @@ utils_opts = [
default="/etc/nova/rootwrap.conf",
help='Path to the rootwrap configuration file to use for '
'running commands as root'),
+ cfg.StrOpt('tempdir',
+ default=None,
+ help='Explicitly specify the temporary working directory'),
]
CONF = cfg.CONF
CONF.register_opts(monkey_patch_opts)
@@ -1147,6 +1150,7 @@ def temporary_chown(path, owner_uid=None):
@contextlib.contextmanager
def tempdir(**kwargs):
+ tempfile.tempdir = CONF.tempdir
tmpdir = tempfile.mkdtemp(**kwargs)
try:
yield tmpdir