]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Make flavor-list regexp more robust
authorSteve Baker <sbaker@redhat.com>
Fri, 25 Jan 2013 05:07:17 +0000 (18:07 +1300)
committerSteve Baker <sbaker@redhat.com>
Fri, 25 Jan 2013 05:13:46 +0000 (18:13 +1300)
This was failing for me due to different amounts of
whitespace in the output.

Change-Id: Id8cb7b63f770504df535542dd420f20a70b4b071

tools/nova_create_flavors.sh

index 6c760fea5f147bad651b8cb56e9bf4a3ce48b2c0..246e775ce8983a6b8fb8ab57692c0f05afc9e711 100755 (executable)
@@ -75,7 +75,7 @@ fi
 # flavors we're about to create, and no others
 FLAVORS="t1\.micro|m1\.tiny|m1\.small|m1\.medium|m1\.large|m1\.xlarge|m2\.xlarge|m2\.2xlarge|m2\.4xlarge|c1\.medium|c1\.xlarge|cc1\.4xlarge"
 
-for f in $(nova flavor-list | grep -E "^\| [0-9]+\s+ \| ($FLAVORS)\s" | awk '{print $2}')
+for f in $(nova flavor-list | grep -E "^\|\s+[0-9]+\s+\|\s+($FLAVORS)\s" | awk '{print $2}')
 do
     retry_cmd "nova flavor-delete $f"
 done