From 5b5e2e6b0b26f5d938008ab640c032e6facb18b9 Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 9 May 2017 22:02:14 -0400 Subject: Bugfix: Error when create pod.yaml file JIRA: DOVETAIL-426 os.path.makedirs(os.path.dirname(args.filepath)) AttributeError: 'module' object has no attribute 'makedirs' Change-Id: I2b75576f05b7926b76148ea6152e4479215344f5 Signed-off-by: xudan --- jjb/dovetail/dovetail-run.sh | 5 +++++ utils/create_pod_file.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh index 5f462e9c3..cee9e5929 100755 --- a/jjb/dovetail/dovetail-run.sh +++ b/jjb/dovetail/dovetail-run.sh @@ -65,6 +65,11 @@ else fi pod_file_dir="/home/opnfv/dovetail/userconfig" +if [ -d ${pod_file_dir} ]; then + sudo rm -r ${pod_file_dir}/* +else + sudo mkdir -p ${pod_file_dir} +fi cmd="sudo python ${releng_repo}/utils/create_pod_file.py -t ${INSTALLER_TYPE} -i ${INSTALLER_IP} ${options} -f ${pod_file_dir}/pod.yaml" echo ${cmd} ${cmd} diff --git a/utils/create_pod_file.py b/utils/create_pod_file.py index 7e30cc639..197e4933c 100644 --- a/utils/create_pod_file.py +++ b/utils/create_pod_file.py @@ -58,7 +58,7 @@ def create_file(handler): Other installers use key file of each node. """ if not os.path.exists(os.path.dirname(args.filepath)): - os.path.makedirs(os.path.dirname(args.filepath)) + os.makedirs(os.path.dirname(args.filepath)) nodes = handler.nodes node_list = [] index = 1 -- cgit 1.2.3-korg