summaryrefslogtreecommitdiffstats
path: root/ci/clean.sh
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-03-08 16:19:04 -0500
committerDan Radez <dradez@redhat.com>2016-04-01 19:12:25 -0400
commit9a96f371f290fdf8530239a4c0df591527fe636f (patch)
tree7450d1b1e6023adf1cc82de5b3523518ce421590 /ci/clean.sh
parent53003f9fef6b49304f37e5fbb5d15bc4f1316948 (diff)
Migrating to Mitaka
- Only support for NOSDN for this patch - Other SDN controllers will not be tested for this patch - AODH is now upstream and not needed to be carried in Apex - puppet-cinder-quota-fix.patch is now upstream and not needed to be carried in Apex - puppet-neutron-force-metadata.patch is now upstream and not needed to be carried in Apex - removing the catalog of nic files and creating a templatization for them JIRA: APEX-108 JIRA: APEX-93 JIRA: APEX-92 Change-Id: Ic1a24baec7ef295e9dc1b8b72ac36ca5b05578ea Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'ci/clean.sh')
-rwxr-xr-xci/clean.sh29
1 files changed, 13 insertions, 16 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 40ae6edd..2a91b7ce 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -11,7 +11,9 @@
#Clean script to uninstall provisioning server for Apex
#author: Dan Radez (dradez@redhat.com)
#author: Tim Rozet (trozet@redhat.com)
-CONFIG=/var/opt/opnfv
+
+# Use default if no param passed
+CONFIG=${1-"/var/opt/opnfv"}
##LIBRARIES
source $CONFIG/lib/common-functions.sh
@@ -21,31 +23,26 @@ ovs_bridges="br-admin br-private br-public br-storage"
# 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
+ virsh destroy $vm 2> /dev/null | xargs echo -n
+ virsh undefine $vm 2> /dev/null | xargs echo -n
+ /usr/bin/touch /var/lib/libvirt/images/${vm}.qcow2
+ virsh vol-delete ${vm}.qcow2 --pool default 2> /dev/null | xargs echo -n
+ rm -f /var/lib/libvirt/images/${vm}.qcow2 2> /dev/null
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
- virsh destroy baremetal$i 2> /dev/null || echo -n ''
- virsh undefine baremetal$i 2> /dev/null || echo -n ''
+ virsh destroy baremetal$i 2> /dev/null | xargs echo -n
+ virsh undefine baremetal$i 2> /dev/null | xargs echo -n
/usr/bin/touch /var/lib/libvirt/images/baremetal${i}.qcow2
- virsh vol-delete baremetal${i}.qcow2 --pool default 2> /dev/null
+ virsh vol-delete baremetal${i}.qcow2 --pool default 2> /dev/null | xargs echo -n
rm -f /var/lib/libvirt/images/baremetal${i}.qcow2 2> /dev/null
done
# Clean off created bridges
for bridge in ${ovs_bridges}; do
- virsh net-destroy ${bridge} 2> /dev/null
- virsh net-undefine ${bridge} 2> /dev/null
+ virsh net-destroy ${bridge} 2> /dev/null | xargs echo -n
+ virsh net-undefine ${bridge} 2> /dev/null | xargs echo -n
if detach_interface_from_ovs ${bridge} 2> /dev/null; then
ovs-vsctl del-br ${bridge} 2> /dev/null
fi