Add quoting variable for vnname.

The script can be call with quoted param.
It's mandatory to get the mac of only one vm.
example: tripleo get-vm-mac " instack-server "

Change-Id: I3168c2c63c2d87aa243ab819b9977ec659721026
This commit is contained in:
Pierre Blanc 2015-10-27 17:08:08 -04:00 committed by Ben Nemec
parent 7461b01e39
commit a100a94494

View File

@ -8,9 +8,9 @@ if [ "$#" -lt 1 ]; then
exit 1
fi
VMNAME=$1
VMNAME="$1"
vms=$(sudo virsh list --all | grep $VMNAME | awk '{ print $2 }')
vms=$(sudo virsh list --all | grep "$VMNAME" | awk '{ print $2 }')
macs=""
for vm in $vms ; do