From: Vratko Polak Date: Wed, 12 Sep 2018 11:16:22 +0000 (+0200) Subject: Fix: trap for unreserve before cleanup X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=6d105d22e67c3bedf54e6bbb904cb8eb4f05e5f6 Fix: trap for unreserve before cleanup Change-Id: I978a056ffdfd6daa00a0a1c587774b4a7204b434 Signed-off-by: Vratko Polak --- diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index f08d7f2818..f07997dfc3 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -303,9 +303,6 @@ function reserve_testbed () { if [[ "${result}" == "0" ]]; then WORKING_TOPOLOGY="${topo}" echo "Reserved: ${WORKING_TOPOLOGY}" - python "${PYTHON_SCRIPTS_DIR}/topo_cleanup.py" -t "${topo}" || { - die "Testbed cleanup failed." - } trap "untrap_and_unreserve_testbed" EXIT || { message="TRAP ATTEMPT AND UNRESERVE FAILED, FIX MANUALLY." untrap_and_unreserve_testbed "${message}" || { @@ -313,6 +310,9 @@ function reserve_testbed () { } die "Trap attempt failed, unreserve succeeded. Aborting." } + python "${PYTHON_SCRIPTS_DIR}/topo_cleanup.py" -t "${topo}" || { + die "Testbed cleanup failed." + } break fi done