Bugfix: Error when create pod.yaml file 25/34525/2
authorxudan <xudan16@huawei.com>
Wed, 10 May 2017 02:02:14 +0000 (22:02 -0400)
committerxudan <xudan16@huawei.com>
Wed, 10 May 2017 02:53:09 +0000 (22:53 -0400)
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 <xudan16@huawei.com>
jjb/dovetail/dovetail-run.sh
utils/create_pod_file.py

index 5f462e9..cee9e59 100755 (executable)
@@ -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}
index 7e30cc6..197e493 100644 (file)
@@ -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