diff options
author | Peter Mikus <pmikus@cisco.com> | 2020-01-24 14:56:57 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2020-02-04 15:22:38 +0000 |
commit | 2cf0755933dac3e95c10928347996bad3cbe0a42 (patch) | |
tree | 89a79eb7b4a27e47b60b4ac1e6bb6eb56903b781 /resources/libraries/bash/function/common.sh | |
parent | 35024b691ade4278f49d8a65d237c7112fa32bc2 (diff) |
Ansible: Cleanup and speedup
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: Ia2ce482798204ad426f93f334c97e28eb51139fd
Diffstat (limited to 'resources/libraries/bash/function/common.sh')
-rw-r--r-- | resources/libraries/bash/function/common.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 38ba60116a..f89f71dc65 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -561,7 +561,7 @@ function reserve_and_cleanup_testbed () { # - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed. # Functions called: # - die - Print to stderr and exit. - # - ansible_hosts - Perform an action using ansible, see ansible.sh + # - ansible_playbook - Perform an action using ansible, see ansible.sh # Traps registered: # - EXIT - Calls cancel_all for ${WORKING_TOPOLOGY}. @@ -588,9 +588,9 @@ function reserve_and_cleanup_testbed () { } die "Trap attempt failed, unreserve succeeded. Aborting." } - # Cleanup check. + # Cleanup + calibration checks. set +e - ansible_hosts "cleanup" + ansible_playbook "cleanup, calibration" result="$?" set -e if [[ "${result}" == "0" ]]; then @@ -1033,7 +1033,7 @@ function untrap_and_unreserve_testbed () { # - EXIT - Failure to untrap is reported, but ignored otherwise. # Functions called: # - die - Print to stderr and exit. - # - ansible_hosts - Perform an action using ansible, see ansible.sh + # - ansible_playbook - Perform an action using ansible, see ansible.sh set -xo pipefail set +eu # We do not want to exit early in a "teardown" function. @@ -1043,7 +1043,7 @@ function untrap_and_unreserve_testbed () { set -eu warn "Testbed looks unreserved already. Trap removal failed before?" else - ansible_hosts "cleanup" || true + ansible_playbook "cleanup" || true python3 "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -c -t "${wt}" || { die "${1:-FAILED TO UNRESERVE, FIX MANUALLY.}" 2 } |