Merge "Check if flavors exist before creating them."

This commit is contained in:
Jenkins 2013-11-21 15:11:03 +00:00 committed by Gerrit Code Review
commit c3dff93fcb

View File

@ -73,6 +73,7 @@ function configure_tempest() {
local password local password
local line local line
local flavors local flavors
local available_flavors
local flavors_ref local flavors_ref
local flavor_lines local flavor_lines
local public_network_id local public_network_id
@ -142,10 +143,15 @@ function configure_tempest() {
# If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior
# Tempest creates instane types for himself # Tempest creates instane types for himself
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
available_flavors=$(nova flavor-list)
if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
nova flavor-create m1.nano 42 64 0 1 nova flavor-create m1.nano 42 64 0 1
fi
flavor_ref=42 flavor_ref=42
boto_instance_type=m1.nano boto_instance_type=m1.nano
if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
nova flavor-create m1.micro 84 128 0 1 nova flavor-create m1.micro 84 128 0 1
fi
flavor_ref_alt=84 flavor_ref_alt=84
else else
# Check Nova for existing flavors and, if set, look for the # Check Nova for existing flavors and, if set, look for the