summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-09-08 16:00:43 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-08 16:00:43 +0000
commit9ad2cd95cb811855cd6dbaf4789d9326ddd5b9b4 (patch)
tree59ef0a1f4156b29509103ac2cf6357dfbce8973a
parent57b9c05dd1881b7b4ddd2f97fdbd80047d6eb3ca (diff)
parentca575d303adcc799505863c4d389fc4bb37635b9 (diff)
Merge "Adjustments to tmp dir handling"
-rw-r--r--apex/deploy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/apex/deploy.py b/apex/deploy.py
index 1cab0d6c..9ebc3f62 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -34,7 +34,7 @@ from apex.undercloud import undercloud as uc_lib
from apex.overcloud import config as oc_cfg
from apex.overcloud import overcloud_deploy
-APEX_TEMP_DIR = tempfile.mkdtemp()
+APEX_TEMP_DIR = tempfile.mkdtemp(prefix='apex_tmp')
ANSIBLE_PATH = 'ansible/playbooks'
SDN_IMAGE = 'overcloud-full-opendaylight.qcow2'
@@ -369,10 +369,11 @@ def main():
utils.run_ansible(deploy_vars, deploy_playbook, host=undercloud.ip,
user='stack', tmp_dir=APEX_TEMP_DIR)
logging.info("Overcloud deployment complete")
- os.remove(os.path.join(APEX_TEMP_DIR, 'overcloud-full.qcow2'))
except Exception:
logging.error("Deployment Failed. Please check log")
raise
+ finally:
+ os.remove(os.path.join(APEX_TEMP_DIR, 'overcloud-full.qcow2'))
# Post install
logging.info("Executing post deploy configuration")