[jenkins]process leaked 31/8831/1
authorcarey.xu <carey.xuhan@huawei.com>
Mon, 1 Feb 2016 03:50:38 +0000 (11:50 +0800)
committershuai chen <chenshuai@huawei.com>
Mon, 1 Feb 2016 08:36:27 +0000 (08:36 +0000)
JIRA: COMPASS-297

Change-Id: I82dbc1d4f14667c90eeb2a759821d7e4271f9dc0
Signed-off-by: carey.xu <carey.xuhan@huawei.com>
(cherry picked from commit a863046c1ba5e12825ba17ed47d333cdc988aaad)

deploy/deploy_host.sh

index 9617b24..1753866 100755 (executable)
@@ -14,12 +14,12 @@ function rename_nics(){
 }
 
 function deploy_host(){
-
+    AYNC_TIMEOUT = 20
     ssh $ssh_args root@${MGMT_IP} mkdir -p /opt/compass/bin/ansible_callbacks
     scp $ssh_args -r ${COMPASS_DIR}/deploy/status_callback.py root@${MGMT_IP}:/opt/compass/bin/ansible_callbacks/status_callback.py
 
     # avoid nodes reboot to fast, cobbler can not give response
-    (sleep 20; rename_nics; reboot_hosts) &
+    (sleep $AYNC_TIMEOUT; rename_nics; reboot_hosts) &
     if [[ "$REDEPLOY_HOST" == true ]]; then
         deploy_flag="redeploy"
     else
@@ -47,4 +47,7 @@ function deploy_host(){
     --enable_secgroup="${ENABLE_SECGROUP}" --enable_fwaas="${ENABLE_FWAAS}" \
     --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}"
 
+    RET=$?
+    sleep $((AYNC_TIMEOUT+5))
+    exit $RET
 }