summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-11-25 17:34:52 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2015-11-25 17:34:52 +0100
commit0030d1a79c8221c5f0d4cc3270037bb15ec535e0 (patch)
treec9af32a4c6cfbeb31bf3a1c326c399553c2bce6b
parente2585202e8ae743a6d4a69e4e26b3016be14ba9e (diff)
Don't check for env variables if openstack credentials are given
JIRA: FUNCTEST-100 Change-Id: Ibef44cf00ec2a2b0ff5bfe21465918ff86bfc589 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rwxr-xr-xdocker/prepare_env.sh29
1 files changed, 17 insertions, 12 deletions
diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh
index b630c37f3..3353a342c 100755
--- a/docker/prepare_env.sh
+++ b/docker/prepare_env.sh
@@ -56,21 +56,26 @@ else
info "MODE: offline"
fi
+# definition of available installer names
+INSTALLERS=(fuel foreman compass apex joid)
-# Check if environment variables are set
-info "Checking environment variables INSTALLER_TYPE and INSTALLER_IP"
-if [ -z ${INSTALLER_TYPE} ]; then
- error "Environment variable 'INSTALLER_TYPE' is not defined."
-elif [[ ${INSTALLER_TYPE} =~ ^(fuel|foreman|compass|apex|joid)$ ]]; then
- info "INSTALLER_TYPE env variable found: ${INSTALLER_TYPE}"
-else
- error "Invalid environment variable INSTALLER_TYPE=${INSTALLER_TYPE}"
-fi
+if [ ! -f ${FUNCTEST_CONF_DIR}/openstack.creds ]; then
+ # If credentials file is not given, check if environment variables are set
+ # to get the creds using fetch_os_creds.sh later on
+ info "Checking environment variables INSTALLER_TYPE and INSTALLER_IP"
+ if [ -z ${INSTALLER_TYPE} ]; then
+ error "Environment variable 'INSTALLER_TYPE' is not defined."
+ elif [[ ${INSTALLERS[@]} =~ ${INSTALLER_TYPE} ]]; then
+ info "INSTALLER_TYPE env variable found: ${INSTALLER_TYPE}"
+ else
+ error "Invalid environment variable INSTALLER_TYPE=${INSTALLER_TYPE}"
+ fi
-if [ -z ${INSTALLER_IP} ]; then
- error "Environment variable 'INSTALLER_IP' is not defined."
+ if [ -z ${INSTALLER_IP} ]; then
+ error "Environment variable 'INSTALLER_IP' is not defined."
+ fi
+ info "INSTALLER_IP env variable found: ${INSTALLER_IP}"
fi
-info "INSTALLER_IP env variable found: ${INSTALLER_IP}"
if [ $offline == false ]; then