summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-08-10 15:16:10 +0300
committerMarkos Chandras <mchandras@suse.de>2018-08-10 15:47:27 +0300
commit37c164735db1e84e1b228c15c94ff165d67c201b (patch)
treee0f9df0b5ae6191560835547e4b2fb1e0d2021fc
parent10c6ad4d3adae775b17418b618b0dfd64d6e2182 (diff)
xci: xci-destroy-env.sh: Update virtualbmc path
Bifrost no longer installs on the deployment host so we don't need to look into the bifrost venv for a vbmc installation. Moreover, XCI uses virtualenv by default, so we should only look there for vbmc. Finally, we should clear vbmc config files from previous deployments since that could leave artifacts behind. Change-Id: I4cd35636a65e1823c9e4ca9a7c5b17d4b103c6a2 Signed-off-by: Markos Chandras <mchandras@suse.de>
-rwxr-xr-xxci/files/xci-destroy-env.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/xci/files/xci-destroy-env.sh b/xci/files/xci-destroy-env.sh
index c95ea838..6c146b0a 100755
--- a/xci/files/xci-destroy-env.sh
+++ b/xci/files/xci-destroy-env.sh
@@ -24,17 +24,15 @@ rm -rf ${HOME}/.ansible
# Wipe repos
rm -rf ${XCI_CACHE}/repos
-# bifrost installs everything on venv so we need to look there if virtualbmc is not installed on the host.
-if which vbmc &>/dev/null || { [[ -e ${XCI_VENV}/bifrost/bin/activate ]] && source ${XCI_VENV}/bifrost/bin/activate; }; then
+if which ${XCI_VENV}/bin/vbmc &>/dev/null; then
# Delete all libvirt VMs and hosts from vbmc (look for a port number)
- for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
+ for vm in $(${XCI_VENV}/bin/vbmc list | awk '/[0-9]/{{ print $2 }}'); do
if which virsh &>/dev/null; then
- virsh destroy $vm &>/dev/null || true
- virsh undefine $vm &>/dev/null || true
+ virsh destroy $vm || true
+ virsh undefine $vm || true
fi
- vbmc delete $vm
+ ${XCI_VENV}/bin/vbmc delete $vm
done
- which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; }
fi
# Destroy all XCI VMs on all flavors
@@ -42,8 +40,8 @@ for varfile in ${flavors[@]}; do
source ${XCI_PATH}/xci/config/${varfile}-vars
for vm in ${NODE_NAMES}; do
if which virsh &>/dev/null; then
- virsh destroy $vm &>/dev/null || true
- virsh undefine $vm &>/dev/null || true
+ virsh destroy $vm &> /dev/null || true
+ virsh undefine $vm &> /dev/null || true
fi
done
done
@@ -84,5 +82,7 @@ service ironic-conductor start || true
service ironic-inspector restart || true
rm -rf ${XCI_VENV}
+# We also need to clear up previous vbmc config dirs
+rm -r ${HOME}/.vbmc
# vim: set ts=4 sw=4 expandtab: