fix 'unary operator expected' in conditional expression
[apex.git] / ci / clean.sh
index 45486de..8b0c9bb 100755 (executable)
@@ -1,4 +1,12 @@
 #!/usr/bin/env bash
+##############################################################################
+# Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
 
 #Clean script to uninstall provisioning server for Apex
 #author: Dan Radez (dradez@redhat.com)
@@ -13,7 +21,7 @@ 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 ''
-if ! virsh vol-delete instack.qcow2 --pool default; then
+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
@@ -34,7 +42,7 @@ done
 for bridge in ${ovs_bridges}; do
   virsh net-destroy ${bridge} 2> /dev/null
   virsh net-undefine ${bridge} 2> /dev/null
-  if detach_interface_from_ovs ${bridge}; then
+  if detach_interface_from_ovs ${bridge} 2> /dev/null; then
     ovs-vsctl del-br ${bridge} 2> /dev/null
   fi
 done