]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Only delete the flavors that the script will then replace.
authorClint Byrum <clint@fewbar.com>
Wed, 16 Jan 2013 16:47:14 +0000 (08:47 -0800)
committerClint Byrum <clint@fewbar.com>
Wed, 16 Jan 2013 17:05:42 +0000 (09:05 -0800)
Change-Id: I9e78a1f98c0ba8d449e127a415baac8c469389a3
Fixes: bug #1100365
tools/nova_create_flavors.sh

index 8481723ccd744a46071245b3e39133aff7d1d5e1..6c760fea5f147bad651b8cb56e9bf4a3ce48b2c0 100755 (executable)
@@ -71,7 +71,11 @@ then
     exit 1
 fi
 
-for f in $(nova flavor-list | grep "^| [0-9]" | awk '{print $2}')
+# This list should match the flavor-creates below to be sure we remove the
+# 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}')
 do
     retry_cmd "nova flavor-delete $f"
 done