Use sudo+virsh to clean instances frm previous run
* fixes bug 955782
Change-Id: I8868132d5e18908d309da025760582a778ab4e72
diff --git a/stack.sh b/stack.sh
index f6b5e9e..55c8a45 100755
--- a/stack.sh
+++ b/stack.sh
@@ -990,10 +990,10 @@
clean_iptables
# Destroy old instances
- instances=`virsh list --all | grep $INSTANCE_NAME_PREFIX | sed "s/.*\($INSTANCE_NAME_PREFIX[0-9a-fA-F]*\).*/\1/g"`
+ instances=`sudo 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 || true
- echo $instances | xargs -n1 virsh undefine || true
+ echo $instances | xargs -n1 sudo virsh destroy || true
+ echo $instances | xargs -n1 sudo virsh undefine || true
fi
# Logout and delete iscsi sessions