diff options
Diffstat (limited to 'ci/clean.sh')
-rwxr-xr-x | ci/clean.sh | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/ci/clean.sh b/ci/clean.sh index 2b488804..bc193a34 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -4,7 +4,7 @@ #author: Dan Radez (dradez@redhat.com) # vm_index=4 - +ovs_bridges="brbm brbm1 brbm2 brbm3" # Clean off instack VM virsh destroy instack 2> /dev/null || echo -n '' virsh undefine instack --remove-all-storage 2> /dev/null || echo -n '' @@ -13,20 +13,18 @@ rm -f /var/lib/libvirt/images/instack.qcow2 2> /dev/null # Clean off baremetal VMs in case they exist for i in $(seq 0 $vm_index); do - virsh destroy baremetalbrbm_brbm1_$i 2> /dev/null || echo -n '' - virsh undefine baremetalbrbm_brbm1_$i --remove-all-storage 2> /dev/null || echo -n '' - virsh vol-delete baremetalbrbm_brbm1_${i}.qcow2 --pool default 2> /dev/null - rm -f /var/lib/libvirt/images/baremetalbrbm_brbm1_${i}.qcow2 2> /dev/null + virsh destroy baremetalbrbm_brbm1_brbm2_brbm3_$i 2> /dev/null || echo -n '' + virsh undefine baremetalbrbm_brbm1_brbm2_brbm3_$i --remove-all-storage 2> /dev/null || echo -n '' + virsh vol-delete baremetalbrbm_brbm1_brbm2_brbm3_${i}.qcow2 --pool default 2> /dev/null + rm -f /var/lib/libvirt/images/baremetalbrbm_brbm1_brbm2_brbm3_${i}.qcow2 2> /dev/null done -# Clean off brbm bridges -virsh net-destroy brbm 2> /dev/null -virsh net-undefine brbm 2> /dev/null -vs-vsctl del-br brbm 2> /dev/null - -virsh net-destroy brbm1 2> /dev/null -virsh net-undefine brbm1 2> /dev/null -vs-vsctl del-br brbm1 2> /dev/null +# Clean off created bridges +for bridge in ${ovs_bridges}; do + virsh net-destroy ${bridge} 2> /dev/null + virsh net-undefine ${bridge} 2> /dev/null + ovs-vsctl del-br ${bridge} 2> /dev/null +done # clean pub keys from root's auth keys sed -i '/stack@instack.localdomain/d' /root/.ssh/authorized_keys |