handle nova servers with spaces in the name

Change-Id: I8cb06860b984dd4bc4d17920bfbe9c78e15ff9ac
This commit is contained in:
Marcus Furlong 2016-04-19 10:12:15 +10:00
parent 6492a37e76
commit 0b849f430a
1 changed files with 4 additions and 1 deletions

View File

@ -5,8 +5,11 @@
#
# Author: Mike Dorman <mdorman@godaddy.com>
IFS="
"
for i in `nova list --all-tenants | grep -v '^+-' | grep -v '^| ID' |\
awk '{print $2 "," $4 "," $6;}'`; do
cut -d "|" -f 2,3,5 | sed -e "s/ *| */,/g" -e "s/^ *//g"` ; do
ID=`echo $i | cut -d, -f 1`
NAME=`echo $i | cut -d, -f 2`
STATUS=`echo $i | cut -d, -f 3`