summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaspars Skels <kaspars.skels@gmail.com>2019-01-24 17:54:37 -0600
committerKaspars Skels <kaspars.skels@gmail.com>2019-01-24 17:54:37 -0600
commit0f800ebaa4506e52326352e1024ed0e46ba704d7 (patch)
tree4541c60b047817b16e92718e4541d4c817405e2c
parent58bcb4855b406f4559bad5f21c58e2d1101d78cb (diff)
Fix Shipyard wait to catch errors that occur in steps
Notes
Notes (review): Code-Review+2: Bryan Strassner <strassner.bryan@gmail.com> Code-Review+2: Matt McEuen <matt.mceuen@att.com> Workflow+1: Matt McEuen <matt.mceuen@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 25 Jan 2019 19:19:34 +0000 Reviewed-on: https://review.openstack.org/633089 Project: openstack/airship-in-a-bottle Branch: refs/heads/master
-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