Browse code

Better domain parsing and improved instance cleanup

* Fixes bug 911506
* Fix typo - logical or not pipe

Change-Id: Id92a7e1d7e974710635899d43a7d428ce525227c

Anthony Young authored on 2012/01/05 02:32:48
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.