aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/bash/function/common.sh50
1 files changed, 22 insertions, 28 deletions
diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh
index 9db0ac8dcb..8296e8176f 100644
--- a/resources/libraries/bash/function/common.sh
+++ b/resources/libraries/bash/function/common.sh
@@ -311,37 +311,31 @@ function deactivate_docker_topology () {
# Variables read:
# - NODENESS - Node multiplicity of desired testbed.
# - FLAVOR - Node flavor string, usually describing the processor.
- # - CSIT_NO_CLEANUP - Variable to disable cleaning up the environment.
set -exuo pipefail
- if [[ ${CSIT_NO_CLEANUP:-0} -eq 0 ]]; then
- case_text="${NODENESS}_${FLAVOR}"
- case "${case_text}" in
- "1n_skx" | "1n_tx2" | "1n_spr")
- ssh="ssh root@172.17.0.1 -p 6022"
- env_vars=$(env | grep CSIT_ | tr '\n' ' ' ) || die
- # The "declare -f" output is long and boring.
- set +x
- ${ssh} "$(declare -f); deactivate_wrapper ${env_vars}" || {
- die "Topology cleanup via shim-dcr failed!"
- }
- set -x
- ;;
- "1n_vbox")
- enter_mutex || die
- clean_environment || {
- die "Topology cleanup locally failed!"
- }
- exit_mutex || die
- ;;
- *)
- die "Unknown specification: ${case_text}!"
- esac
- else
- echo "CSIT_NO_CLEANUP environment variable is set"
- echo "Environment Cleanup Abandoned"
- fi
+ case_text="${NODENESS}_${FLAVOR}"
+ case "${case_text}" in
+ "1n_skx" | "1n_tx2" | "1n_spr")
+ ssh="ssh root@172.17.0.1 -p 6022"
+ env_vars=$(env | grep CSIT_ | tr '\n' ' ' ) || die
+ # The "declare -f" output is long and boring.
+ set +x
+ ${ssh} "$(declare -f); deactivate_wrapper ${env_vars}" || {
+ die "Topology cleanup via shim-dcr failed!"
+ }
+ set -x
+ ;;
+ "1n_vbox")
+ enter_mutex || die
+ clean_environment || {
+ die "Topology cleanup locally failed!"
+ }
+ exit_mutex || die
+ ;;
+ *)
+ die "Unknown specification: ${case_text}!"
+ esac
}