Use playbook status to report upgrade failure
Previously, we simply checked $? which at that point would be the exit
status of echo, not openstack-ansible. By recording the actual
openstack-ansible exit status, we can properly report failures of the
upgrade script.
Closes-bug: 1480342
Change-Id: Icf43bea84660e4160a2dfcdb4ac93055340b3573
(cherry picked from commit 8a106d184a)
This commit is contained in:
committed by
Jesse Pretorius
parent
4c9d94880f
commit
58d0daef9b
@@ -81,9 +81,10 @@ function run_lock() {
|
|||||||
# Into a command, otherwise we'll get an error that there's no playbook
|
# Into a command, otherwise we'll get an error that there's no playbook
|
||||||
# named ||
|
# named ||
|
||||||
eval "openstack-ansible $2"
|
eval "openstack-ansible $2"
|
||||||
|
playbook_status="$?"
|
||||||
echo "ran $run_item"
|
echo "ran $run_item"
|
||||||
|
|
||||||
if [ "$?" == "0" ];then
|
if [ "$playbook_status" == "0" ];then
|
||||||
RUN_TASKS=("${RUN_TASKS[@]/$run_item}")
|
RUN_TASKS=("${RUN_TASKS[@]/$run_item}")
|
||||||
touch "$upgrade_marker"
|
touch "$upgrade_marker"
|
||||||
echo "$run_item has been marked as success"
|
echo "$run_item has been marked as success"
|
||||||
|
|||||||
Reference in New Issue
Block a user