fix(core): Remove unwanted code 18/39818/1
authorpmikus <peter.mikus@protonmail.ch>
Thu, 2 Nov 2023 05:45:53 +0000 (05:45 +0000)
committerpmikus <peter.mikus@protonmail.ch>
Thu, 2 Nov 2023 05:45:53 +0000 (05:45 +0000)
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: Ib03e469da3e93944ae7fb612e7a71df36f711cdd

resources/libraries/bash/function/common.sh

index 9db0ac8..8296e81 100644 (file)
@@ -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
 }