diff options
Diffstat (limited to 'bifrost/scripts')
-rwxr-xr-x | bifrost/scripts/destroy-env.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bifrost/scripts/destroy-env.sh b/bifrost/scripts/destroy-env.sh index 3ee66642..97638303 100755 --- a/bifrost/scripts/destroy-env.sh +++ b/bifrost/scripts/destroy-env.sh @@ -23,8 +23,10 @@ rm -rf ${HOME}/.config/openstack 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 + if which virsh &>/dev/null; then + virsh destroy $vm || true + virsh undefine $vm || true + fi vbmc delete $vm done which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; } |