summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/clean.sh')
-rwxr-xr-xci/clean.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index c031e5e4..40ae6edd 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -18,17 +18,20 @@ source $CONFIG/lib/common-functions.sh
vm_index=4
ovs_bridges="br-admin br-private br-public br-storage"
-# Clean off instack VM
-virsh destroy instack 2> /dev/null || echo -n ''
-virsh undefine instack 2> /dev/null || echo -n ''
-if ! virsh vol-delete instack.qcow2 --pool default 2> /dev/null; then
- if [ ! -e /var/lib/libvirt/images/instack.qcow2 ]; then
- /usr/bin/touch /var/lib/libvirt/images/instack.qcow2
- virsh vol-delete instack.qcow2 --pool default
- fi
-fi
-rm -f /var/lib/libvirt/images/instack.qcow2 2> /dev/null
+# Clean off instack/undercloud VM
+for vm in instack undercloud; do
+ virsh destroy $vm 2> /dev/null || echo -n ''
+ virsh undefine $vm 2> /dev/null || echo -n ''
+ if ! virsh vol-delete ${vm}.qcow2 --pool default 2> /dev/null; then
+ if [ ! -e /var/lib/libvirt/images/${vm}.qcow2 ]; then
+ /usr/bin/touch /var/lib/libvirt/images/${vm}.qcow2
+ virsh vol-delete ${vm}.qcow2 --pool default
+ fi
+ fi
+done
+
+rm -f /var/lib/libvirt/images/undercloud.qcow2 2> /dev/null
# Clean off baremetal VMs in case they exist
for i in $(seq 0 $vm_index); do
@@ -49,7 +52,7 @@ for bridge in ${ovs_bridges}; do
done
# clean pub keys from root's auth keys
-sed -i '/stack@instack.localdomain/d' /root/.ssh/authorized_keys
+sed -i '/stack@undercloud.localdomain/d' /root/.ssh/authorized_keys
sed -i '/virtual-power-key/d' /root/.ssh/authorized_keys