summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-11 07:16:05 +0000
committerGerrit Code Review <review@openstack.org>2016-09-11 07:16:05 +0000
commit26087fd58c4d9e39cdf12171266cb21c9f18e1bd (patch)
tree0b636b810fb2850f6b48fc299f5ee039d8412f3c
parent5b3b1efe2510849ac330959672f6ae0cdbf5b394 (diff)
parenta14c5ce2e711c88297b6e6bd3d77295a5d226b87 (diff)
downloadtrove-integration-26087fd58c4d9e39cdf12171266cb21c9f18e1bd.tar.gz
Merge "Speed up creation of flavors"
-rwxr-xr-xscripts/redstack17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/redstack b/scripts/redstack
index 7ac423a..0b5dbcc 100755
--- a/scripts/redstack
+++ b/scripts/redstack
@@ -200,12 +200,15 @@ function ip_chunk() {
# Add a flavor and a corresponding flavor.resize
# (flavor.resize adds 16 to the memory and one more vcpu)
function add_flavor() {
- FLAVOR_NAME=$1
- FLAVOR_ID=$2
- FLAVOR_MEMORY_MB=$3
- FLAVOR_ROOT_GB=$4
- FLAVOR_VCPUS=$5
-
+ local FLAVOR_NAME=$1
+ local FLAVOR_ID=$2
+ local FLAVOR_MEMORY_MB=$3
+ local FLAVOR_ROOT_GB=$4
+ local FLAVOR_VCPUS=$5
+
+ if [[ -z "$FLAVOR_LIST_FOR_ADD" ]]; then
+ FLAVOR_LIST_FOR_ADD=$(nova $credentials flavor-list | cut -d'|' -f3 | sed -e's/ /,/g')
+ fi
credentials="--os-username=admin --os-password=$ADMIN_PASSWORD --os-tenant-name=admin --os-auth-url=$TROVE_AUTH_ENDPOINT"
base_id=${FLAVOR_ID}
@@ -238,7 +241,7 @@ function add_flavor() {
memory=$((${FLAVOR_MEMORY_MB} + 16))
vcpus=$((${FLAVOR_VCPUS} + 1))
fi
- if [[ -z $(nova $credentials flavor-list | grep "| $name[ ]* |") ]]; then
+ if [[ $FLAVOR_LIST_FOR_ADD != *",$name,"* ]]; then
nova $credentials flavor-create $name $id $memory $FLAVOR_ROOT_GB $vcpus --ephemeral $ephemeral
fi
done