Merge "Remove compatibility cruft from overcloud-validate"

This commit is contained in:
Zuul 2018-03-28 21:02:00 +00:00 committed by Gerrit Code Review
commit 0c180c9af4
1 changed files with 5 additions and 19 deletions

View File

@ -7,26 +7,18 @@ set -eux
## ================================= ## =================================
## .. note: The following set of scripts are generated from a jinja template ## .. note: The following set of scripts are generated from a jinja template
## which may be viewed here: https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-validate/blob/master/templates/overcloud-validate.sh.j2 ## which may be viewed here: https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/validate-simple/templates/overcloud-validate.sh.j2
## * Create cleanup env function for heat ## * Create cleanup env function for heat
## :: ## ::
function cleanup { function cleanup {
{% if release in ['kilo', 'liberty', 'rhos-7'] %}
heat stack-delete {{ validate_stack_name }}
{% else %}
openstack stack delete --yes {{ validate_stack_name }} openstack stack delete --yes {{ validate_stack_name }}
{% endif %} if [[ $({{ working_dir }}/wait_for -w 300 -d 30 -s "Stack not found" -- "openstack stack show {{ validate_stack_name }}") ]]; then
if [[ $({{ working_dir }}/wait_for -w 300 -d 30 -s "Stack not found" -- "heat stack-show {{ validate_stack_name }}") ]]; then
echo "openstack stack delete" echo "openstack stack delete"
else else
if [[ $(heat stack-list | grep {{ validate_stack_name }} | grep -i failed) ]]; then if [[ $(openstack stack list | grep {{ validate_stack_name }} | grep -i failed) ]]; then
{% if release in ['kilo', 'liberty', 'rhos-7'] %}
heat stack-delete {{ validate_stack_name }}
{% else %}
openstack stack delete --yes {{ validate_stack_name }} openstack stack delete --yes {{ validate_stack_name }}
{% endif %}
fi fi
fi fi
openstack image list | awk '/pingtest/ {print $2}' | while read IMAGEID; do openstack image delete $IMAGEID; done openstack image list | awk '/pingtest/ {print $2}' | while read IMAGEID; do openstack image delete $IMAGEID; done
@ -55,7 +47,7 @@ source {{ working_dir }}/{{ tenantrc }}
## * Check if an environment is already deployed and, in case, cleanup it ## * Check if an environment is already deployed and, in case, cleanup it
## :: ## ::
[ "x$(heat stack-list | grep {{ validate_stack_name }} || true)" != "x" ] && cleanup [ "x$(openstack stack list | grep {{ validate_stack_name }} || true)" != "x" ] && cleanup
# get validate image # get validate image
if [[ ! -d {{ validate_image_dir }} ]]; then if [[ ! -d {{ validate_image_dir }} ]]; then
mkdir {{ validate_image_dir }}; mkdir {{ validate_image_dir }};
@ -119,15 +111,9 @@ cat << EOF > {{ working_dir }}/validate-template-override.yaml
{{ validate_template_environment|to_nice_yaml }} {{ validate_template_environment|to_nice_yaml }}
EOF EOF
{% if release in ['kilo', 'liberty', 'rhos-7'] %}
heat stack-create {{ validate_stack_name }} \
--template-file {{ validate_template_path }}/{{ validate_template }} \
--environment-file {{ working_dir }}/validate-template-override.yaml
{% else %}
openstack stack create {{ validate_stack_name }} \ openstack stack create {{ validate_stack_name }} \
--template {{ validate_template_path }}/{{ validate_template }} \ --template {{ validate_template_path }}/{{ validate_template }} \
--environment {{ working_dir }}/validate-template-override.yaml --environment {{ working_dir }}/validate-template-override.yaml
{% endif %}
## * Wait for the stack creation to complete ## * Wait for the stack creation to complete
## * Give time to the instance to boot ## * Give time to the instance to boot
@ -135,7 +121,7 @@ openstack stack create {{ validate_stack_name }} \
### --stop_docs ### --stop_docs
/bin/bash {{ working_dir }}/wait_for -w 600 --delay 30 \ /bin/bash {{ working_dir }}/wait_for -w 600 --delay 30 \
--success-match {{ validate_success_status }} \ --success-match {{ validate_success_status }} \
--fail-match {{ validate_failed_status }} -- heat stack-show {{ validate_stack_name }} --fail-match {{ validate_failed_status }} -- openstack stack show {{ validate_stack_name }}
sleep 30 sleep 30
### --start_docs ### --start_docs