Exit deploy when exception occurred 99/43599/1
authorAlex Yang <yangyang1@zte.com.cn>
Fri, 29 Sep 2017 09:29:08 +0000 (17:29 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Fri, 29 Sep 2017 09:29:08 +0000 (17:29 +0800)
Exception occurred in [1]. But te deployment didn't stop and
blocked for a long time.

[1] https://build.opnfv.org/ci/job/daisy-deploy-baremetal-daily-master/169/

Change-Id: I0d5639da1e0d011855df0b0651328f11168e5d01
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
ci/deploy/deploy.sh
deploy/tempest.py

index 208351d..283dad1 100755 (executable)
@@ -462,6 +462,10 @@ fi
 
 echo "====== prepare cluster and pxe ======"
 ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --cluster 'yes'"
+if [ $? -ne 0 ]; then
+    echo "Failed to prepare cluster and pxe, exit!"
+    exit 1
+fi
 
 
 function get_mac_addresses_for_virtual()
@@ -549,6 +553,10 @@ fi
 
 echo "====== prepare host and pxe ======"
 ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py  --dha $DHA --network $NETWORK --host 'yes' --isbare $IS_BARE --scenario $DEPLOY_SCENARIO"
+if [ $? -ne 0 ]; then
+    echo "Failed to prepare host and pxe, exit!"
+    exit 1
+fi
 
 if [ $IS_BARE == 0 ];then
     echo "====== daisy virtual-deploy operating system and openstack ======"
index 916ebad..89411f3 100644 (file)
@@ -138,6 +138,7 @@ def prepare_install():
 
     except Exception:
         print("Deploy failed!!!.%s." % traceback.format_exc())
+        sys.exit(1)
     else:
         print_bar("Everything is done!")