Make a failure to purge_db fail in post_test_hook.sh
Currently, the 'purge_db' call occurs before 'set -e', so if and when the database purge fails (return non-zero) it does not cause the script to exit with a failure. This moves the call after 'set -e' to make the script exit with a failure if the database purge step fails. Closes-Bug: #1840967 Change-Id: I6ae27c4e11acafdc0bba8813f47059d084758b4e
This commit is contained in:
@@ -43,10 +43,17 @@ cell_conf=$(conductor_conf 1)
|
|||||||
# take precedence.
|
# take precedence.
|
||||||
conf="--config-file $NOVA_CONF --config-file $cell_conf"
|
conf="--config-file $NOVA_CONF --config-file $cell_conf"
|
||||||
|
|
||||||
|
# This needs to go before 'set -e' because otherwise the intermediate runs of
|
||||||
|
# 'nova-manage db archive_deleted_rows' returning 1 (normal and expected) would
|
||||||
|
# cause this script to exit and fail.
|
||||||
archive_deleted_rows $conf
|
archive_deleted_rows $conf
|
||||||
purge_db
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# This needs to go after 'set -e' because otherwise a failure to purge the
|
||||||
|
# database would not cause this script to exit and fail.
|
||||||
|
purge_db
|
||||||
|
|
||||||
# We need to get the admin credentials to run the OSC CLIs for Placement.
|
# We need to get the admin credentials to run the OSC CLIs for Placement.
|
||||||
set +x
|
set +x
|
||||||
source $BASE/devstack/openrc admin
|
source $BASE/devstack/openrc admin
|
||||||
|
|||||||
Reference in New Issue
Block a user