summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-25 19:19:34 +0000
committerGerrit Code Review <review@openstack.org>2019-01-25 19:19:34 +0000
commit1a445f3c0b1467164287b94dc98697be6977e372 (patch)
tree2f84c05e9fcf6fc5f5dc999658ef0ad184dd61b0
parente34589c4b36ce749b778e9b78fc5dfe60dc87e29 (diff)
parent0f800ebaa4506e52326352e1024ed0e46ba704d7 (diff)
Merge "Fix Shipyard wait to catch errors that occur in steps"
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/airship.sh44
1 files changed, 28 insertions, 16 deletions
diff --git a/tools/multi_nodes_gate/airship_gate/lib/airship.sh b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
index edb1f4b..35fa938 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/airship.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
@@ -93,24 +93,36 @@ shipyard_action_wait() {
93 log "Shipyard action ${action} did not complete in ${timeout} seconds." 93 log "Shipyard action ${action} did not complete in ${timeout} seconds."
94 return 2 94 return 2
95 fi 95 fi
96 RESULT=$(shipyard_cmd --output-format=raw describe "${ACTION_ID}")
97 ACTION_STATUS=$(echo "${RESULT}" | jq -r '.action_lifecycle')
98 ACTION_RESULT=$(echo "${RESULT}" | jq -r '.dag_status')
99 96
100 if [[ "${ACTION_STATUS}" == "Complete" ]] 97 ACTION_STATUS=$(shipyard_cmd describe "${ACTION_ID}" | grep -i "Lifecycle" | \
101 then 98 awk '{print $2}')
102 if [[ "${ACTION_RESULT}" == "success" ]] 99
103 then 100 ACTION_STEPS=$(shipyard_cmd describe "${ACTION_ID}" | grep -i "step/" | \
104 log "Shipyard action ${action} success!" 101 awk '{print $3}')
105 return 0 102
106 else 103 # Verify lifecycle status
107 log "Shipyard action ${action} completed with result ${ACTION_RESULT}" 104 if [ "${ACTION_STATUS}" == "Failed" ]; then
108 echo "${RESULT}" | jq >> "${LOG_FILE}" 105 echo -e "\n${ACTION_ID} FAILED\n"
109 return 1 106 shipyard_cmd describe "${ACTION_ID}"
110 fi 107 exit 1
111 else
112 sleep "${poll_time}"
113 fi 108 fi
109
110 if [ "${ACTION_STATUS}" == "Complete" ]; then
111 # Verify status of each action step
112 for step in ${ACTION_STEPS}; do
113 if [ "${step}" == "failed" ]; then
114 echo -e "\n${ACTION_ID} FAILED\n"
115 shipyard_cmd describe "${ACTION_ID}"
116 exit 1
117 fi
118 done
119
120 echo -e "\n${ACTION_ID} completed SUCCESSFULLY\n"
121 shipyard_cmd describe "${ACTION_ID}"
122 exit 0
123 fi
124
125 sleep "${poll_time}"
114 done 126 done
115} 127}
116 128