X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fcommon.sh;h=c1593b246677516cf39ba5d983bac91529ad6ba8;hb=e426a0bdf65badd2ffc6b0defdb01094bfb33578;hp=f9c9e2ea918e2d1242cad91bebb36bd43347a1d4;hpb=9bdcc0e3c1e449fe0836eb0335a4c9f7824fe09b;p=csit.git diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index f9c9e2ea91..c1593b2466 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -576,6 +576,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 # Traps registered: # - EXIT - Calls cancel_all for ${WORKING_TOPOLOGY}. @@ -604,7 +605,7 @@ function reserve_and_cleanup_testbed () { } # Cleanup check. set +e - cleanup_topo + ansible_hosts "cleanup" result="$?" set -e if [[ "${result}" == "0" ]]; then @@ -759,7 +760,7 @@ function select_tags () { *"3n-skx"* | *"2n-skx"* | *"2n-clx"*) default_nic="nic_intel-xxv710" ;; - *"3n-hsw"*) + *"3n-hsw"* | *"mrr-daily-master") default_nic="nic_intel-xl710" ;; *) @@ -1031,6 +1032,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 set -xo pipefail set +eu # We do not want to exit early in a "teardown" function. @@ -1040,7 +1042,7 @@ function untrap_and_unreserve_testbed () { set -eu warn "Testbed looks unreserved already. Trap removal failed before?" else - cleanup_topo || true + ansible_hosts "cleanup" || true python "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -c -t "${wt}" || { die "${1:-FAILED TO UNRESERVE, FIX MANUALLY.}" 2 }