From b39d74feda9463d83c99d6baa5eacfc24cfc21b0 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Wed, 16 Jan 2013 08:47:14 -0800 Subject: [PATCH] Only delete the flavors that the script will then replace. Change-Id: I9e78a1f98c0ba8d449e127a415baac8c469389a3 Fixes: bug #1100365 --- tools/nova_create_flavors.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/nova_create_flavors.sh b/tools/nova_create_flavors.sh index 8481723c..6c760fea 100755 --- a/tools/nova_create_flavors.sh +++ b/tools/nova_create_flavors.sh @@ -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 -- 2.45.2