summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2017-09-07 16:57:02 -0400
committerDan Radez <dradez@redhat.com>2017-09-08 09:34:02 -0400
commitca575d303adcc799505863c4d389fc4bb37635b9 (patch)
tree0bf36bdc6ec5b3b9035b9d806957c289b5199a34
parent2ecb25bea8dbb8abc7bd4f90f07101b40e70363b (diff)
Adjustments to tmp dir handling
- prefixing with apex_tmp - removing overcloud qcow on failure JIRA: APEX-513 Change-Id: I766df10c294c31622917bbd5b0597e3373716d8b Signed-off-by: Dan Radez <dradez@redhat.com>
-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")