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
This commit is contained in:
parent
eb435d7326
commit
8a106d184a
@ -81,9 +81,10 @@ function run_lock() {
|
||||
# Into a command, otherwise we'll get an error that there's no playbook
|
||||
# named ||
|
||||
eval "openstack-ansible $2"
|
||||
playbook_status="$?"
|
||||
echo "ran $run_item"
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
if [ "$playbook_status" == "0" ];then
|
||||
RUN_TASKS=("${RUN_TASKS[@]/$run_item}")
|
||||
touch "$upgrade_marker"
|
||||
echo "$run_item has been marked as success"
|
||||
|
Loading…
x
Reference in New Issue
Block a user