diff options
author | Tim Rozet <trozet@redhat.com> | 2017-09-08 16:00:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-08 16:00:43 +0000 |
commit | 9ad2cd95cb811855cd6dbaf4789d9326ddd5b9b4 (patch) | |
tree | 59ef0a1f4156b29509103ac2cf6357dfbce8973a | |
parent | 57b9c05dd1881b7b4ddd2f97fdbd80047d6eb3ca (diff) | |
parent | ca575d303adcc799505863c4d389fc4bb37635b9 (diff) |
Merge "Adjustments to tmp dir handling"
-rw-r--r-- | apex/deploy.py | 5 |
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") |