Browse code

Merge "Better domain parsing and improved instance cleanup"

Jenkins authored on 2012/01/06 08:23:49
Showing 1 changed files
... ...
@@ -843,10 +843,10 @@ if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
843 843
     clean_iptables
844 844
 
845 845
     # Destroy old instances
846
-    instances=`virsh list | grep $INSTANCE_NAME_PREFIX | cut -d " " -f3`
846
+    instances=`virsh list --all | grep $INSTANCE_NAME_PREFIX | sed "s/.*\($INSTANCE_NAME_PREFIX[0-9a-fA-F]*\).*/\1/g"`
847 847
     if [ ! $instances = "" ]; then
848
-        echo $instances | xargs -n1 virsh destroy
849
-        echo $instances | xargs -n1 virsh undefine
848
+        echo $instances | xargs -n1 virsh destroy || true
849
+        echo $instances | xargs -n1 virsh undefine || true
850 850
     fi
851 851
 
852 852
     # Clean out the instances directory.