Source devstack openrc only one time

Recently sourcing of openrc in each function
started to break gates because of sharing
of openrc variables between gate scripts

This commit sources openrc only one time
in top scope

Closes-Bug: #1646448
Change-Id: I51d2f7434a4d72207ee0402e0f1fc335dbec1afb
This commit is contained in:
Mykyta Karpin 2016-11-30 18:59:34 +02:00
parent a29aaa0a3d
commit ac5811e870
2 changed files with 9 additions and 13 deletions

View File

@ -217,10 +217,6 @@ function override_refference() {
function remove_image_with_murano_agent() {
pushd "${STACK_HOME}/devstack"
source openrc "${ADMIN_USERNAME}" "${ADMIN_TENANT}"
popd
for i in $(glance image-list | get_field 2); do
if [ "${DISTR_NAME}_${BUILD_NUMBER}" == "$i" ]; then
glance image-delete "$i"
@ -230,10 +226,6 @@ function remove_image_with_murano_agent() {
function save_image_with_murano_agent() {
pushd "${STACK_HOME}/devstack"
source openrc "${ADMIN_USERNAME}" "${ADMIN_TENANT}"
popd
for i in $(glance image-list | get_field 2); do
if [ "${DISTR_NAME}_latest" == "$i" ]; then
glance image-delete "$i"
@ -256,11 +248,6 @@ function ensure_no_heat_stacks_left() {
pushd "${STACK_HOME}/devstack"
set +o xtrace
echo "Importing openrc ..."
source openrc "${ADMIN_USERNAME}" "${ADMIN_TENANT}"
set -o xtrace
for id in $(sed -n 's/.*\"OS\:\:stack_id\"\: \"\(.\{36\}\)\".*/\1/p' "${log_file}" | sort | uniq); do
stack_info=$(heat stack-list | grep "${id}")
if [ -n "${stack_info}" ]; then
@ -278,6 +265,7 @@ function ensure_no_heat_stacks_left() {
}
function tear_down() {
if [[ "${PROJECT_NAME}" == 'murano-agent' ]]; then
remove_image_with_murano_agent
fi

View File

@ -21,5 +21,13 @@ source "${CI_ROOT_DIR}/scripts/common.inc"
#-----------------
source "${CI_ROOT_DIR}/scripts/deploy_devstack.sh"
pushd "${STACK_HOME}/devstack"
set +o xtrace
echo "Importing openrc ..."
source openrc "${ADMIN_USERNAME}" "${ADMIN_TENANT}"
set -o xtrace
popd
source "${CI_ROOT_DIR}/scripts/prepare_tests.sh"
source "${CI_ROOT_DIR}/scripts/run_tests.sh"