summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-11-05 15:29:06 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2015-11-05 15:30:27 +0100
commitee72ee8f18be243df00fb9671ae0a09eb39c811c (patch)
tree0d674d7ca25b21affbf228c16de89115b2271025
parente2f7d3f8c1ce98b2c65c2c8206389b7533e5ba2e (diff)
Add possibility to give Openstack creds file to the docker container
If the file is given through a docker volume, it will not use fetch_os_creds.sh, it will source it directly. Usage: Add the following to the docker command line: -v $(pwd)/<your_local_creds_file>:/home/opnfv/functest/conf/openstack.creds Change-Id: I24c20378c940aaa1d9f93d5e6c57b3243b50aab5 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rwxr-xr-xdocker/prepare_env.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh
index f3e31d926..1b3144a0d 100755
--- a/docker/prepare_env.sh
+++ b/docker/prepare_env.sh
@@ -155,15 +155,17 @@ mkdir -p ${FUNCTEST_RESULTS_DIR}/ODL
# Create Openstack credentials file
-${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${FUNCTEST_CONF_DIR}/openstack.creds \
- -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
-retval=$?
-if [ $retval != 0 ]; then
- error "Cannot retrieve credentials file from installation. Check logs."
- exit $retval
+if [ ! -f ${FUNCTEST_CONF_DIR}/openstack.creds ]; then
+ ${REPOS_DIR}/releng/utils/fetch_os_creds.sh -d ${FUNCTEST_CONF_DIR}/openstack.creds \
+ -i ${INSTALLER_TYPE} -a ${INSTALLER_IP}
+ retval=$?
+ if [ $retval != 0 ]; then
+ error "Cannot retrieve credentials file from installation. Check logs."
+ exit $retval
+ fi
+else
+ info "OpenStack credentials file given to the docker and stored in ${FUNCTEST_CONF_DIR}/openstack.creds."
fi
-
-
# Source credentials
source ${FUNCTEST_CONF_DIR}/openstack.creds