summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-09-18 15:33:54 +0100
committerMarkos Chandras <mchandras@suse.de>2017-09-21 21:51:43 +0100
commitf2f978fd7a3346c0ba5323fdf22d8d105836ca44 (patch)
tree5410573f0963fd2456bd5d0ac6b14fdf77bbc7a3
parent14d5449ef8de17293f2524005d7c2262f0baa733 (diff)
bifrost: scripts: Look for virtualbmc on bifrost virtualenv
Since I94874d600a29247b7826324cc111901995df90dc, bifrost installs pip packages in virtualenv so we need to look there for virtualbmc if it's not currently installed on the host. Change-Id: Ia4c7e8a75c020dc00b920956495831cc77457876 Signed-off-by: Markos Chandras <mchandras@suse.de>
-rwxr-xr-xbifrost/scripts/destroy-env.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/bifrost/scripts/destroy-env.sh b/bifrost/scripts/destroy-env.sh
index 87f792a5..f6eca4e3 100755
--- a/bifrost/scripts/destroy-env.sh
+++ b/bifrost/scripts/destroy-env.sh
@@ -19,12 +19,17 @@ rm -rf /opt/stack
# HOME is normally set by sudo -H
rm -rf ${HOME}/.config/openstack
-# Delete all libvirt VMs and hosts from vbmc (look for a port number)
-for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
- virsh destroy $vm || true
- virsh undefine $vm || true
- vbmc delete $vm
-done
+# 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 /opt/stack/bifrost/bin/activate ]] && source /opt/stack/bifrost/bin/activate; }; 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
+ virsh destroy $vm || true
+ virsh undefine $vm || true
+ vbmc delete $vm
+ done
+ which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; }
+fi
+
# Destroy all XCI VMs if the previous operation failed
[[ -n ${XCI_FLAVOR} ]] && \
for vm in ${TEST_VM_NODE_NAMES}; do