X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=prototypes%2Fbifrost%2Fscripts%2Fdestroy-env.sh;h=c75e814b73fa7d109e8311afea04928330d5331a;hb=8b2240628d15cb62592c47c9d590f718910e18db;hp=1138da904ef320aa5f6c33ab1d937ec5512231fe;hpb=256593234e316d831476488a71509c30b961600e;p=releng.git diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh index 1138da904..c75e814b7 100755 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ b/prototypes/bifrost/scripts/destroy-env.sh @@ -14,19 +14,23 @@ if [[ $(whoami) != "root" ]]; then exit 1 fi -# Delete all VMs on the slave since proposed patchsets -# may leave undesired VM leftovers -for vm in $(virsh list --all --name); do +# Start fresh +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 -done -# Delete all hosts from vbmc (look for a port number) -for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do vbmc delete $vm done service ironic-conductor stop || true +echo "removing inventory files created by previous builds" +rm -rf /tmp/baremetal.* + echo "removing ironic database" if $(which mysql &> /dev/null); then mysql -u root ironic --execute "drop database ironic;"