Better domain parsing and improved instance cleanup

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

Change-Id: Id92a7e1d7e974710635899d43a7d428ce525227c
This commit is contained in:
Anthony Young 2012-01-04 09:32:48 -08:00
parent 7966a5356d
commit 33d5029041

View File

@ -843,10 +843,10 @@ if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then
clean_iptables
# Destroy old instances
instances=`virsh list | grep $INSTANCE_NAME_PREFIX | cut -d " " -f3`
instances=`virsh list --all | grep $INSTANCE_NAME_PREFIX | sed "s/.*\($INSTANCE_NAME_PREFIX[0-9a-fA-F]*\).*/\1/g"`
if [ ! $instances = "" ]; then
echo $instances | xargs -n1 virsh destroy
echo $instances | xargs -n1 virsh undefine
echo $instances | xargs -n1 virsh destroy || true
echo $instances | xargs -n1 virsh undefine || true
fi
# Clean out the instances directory.