summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-03-22 09:49:33 +0000
committerMarkos Chandras <mchandras@suse.de>2018-03-22 10:00:39 +0000
commit69061efa216c53eb457bedd8cfc545d750ef3c36 (patch)
tree521938c4302189c7fc0c9d54972a96597bd09186
parent8cb2bc0cdf0565ce59546b1ec2aac513fb7fecaa (diff)
xci: files: xci-destroy-env.sh: Remove VMs from all flavors
If we switch from one flavor to another then some VMs may left behind so we need to cleanup the VMs from all flavors. Change-Id: I8b5d400b6d543b32b9cdaff73c3d173984357012 Signed-off-by: Markos Chandras <mchandras@suse.de>
-rwxr-xr-xxci/files/xci-destroy-env.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/xci/files/xci-destroy-env.sh b/xci/files/xci-destroy-env.sh
index 9d53dc15..8b811d0f 100755
--- a/xci/files/xci-destroy-env.sh
+++ b/xci/files/xci-destroy-env.sh
@@ -14,6 +14,8 @@ if [[ $(whoami) != "root" ]]; then
exit 1
fi
+flavors=(aio mini noha ha)
+
# Start fresh
rm -rf /opt/stack
# HOME is normally set by sudo -H
@@ -33,14 +35,16 @@ if which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && sourc
which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; }
fi
-# Destroy all XCI VMs if the previous operation failed
-[[ -n ${XCI_FLAVOR} ]] && \
+# Destroy all XCI VMs on all flavors
+for varfile in ${flavors[@]}; do
+ source ${XCI_PATH}/xci/config/${varfile}-vars
for vm in ${TEST_VM_NODE_NAMES}; do
if which virsh &>/dev/null; then
virsh destroy $vm || true
virsh undefine $vm || true
fi
done
+done
service ironic-conductor stop || true
@@ -76,3 +80,5 @@ service libvirtd restart
service ironic-api restart || true
service ironic-conductor start || true
service ironic-inspector restart || true
+
+# vim: set ts=4 sw=4 expandtab: