summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2015-06-30 23:40:54 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2015-06-30 23:47:44 +0200
commit2d7ea635942c76c1d07d7f108db07c7b3fcdc8fa (patch)
treefad582266ab77303bf9edd7a16e0c583baed663e /utils
parentb79bee8692255ad8dc230437f0d40c021d2c3c40 (diff)
Get vars from env for fetch_os_creds.sh
The vars needed by script is set from env if they're available. Default destination is set to $HOME/opnfv-openrc.sh JIRA: FUNCTEST-16 Change-Id: I92e4498d342f784f9ffdea7a87546b4fbacc09f7 Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/fetch_os_creds.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh
index 48498b70c..cd53dac2d 100755
--- a/utils/fetch_os_creds.sh
+++ b/utils/fetch_os_creds.sh
@@ -52,12 +52,16 @@ while getopts ":d:i:a:h:" optchar; do
esac
done
+# set vars from env if not provided by user as options
+dest_path=${dest_path:-$HOME/opnfv-openrc.sh}
+installer_type=${installer_type:-$INSTALLER_TYPE}
+installer_ip=${installer_ip:-$INSTALLER_IP}
+
if [ -z $dest_path ] || [ -z $installer_type ] || [ -z $installer_ip ]; then
usage
exit 2
fi
-
# Checking if destination path is valid
if [ -d $dest_path ]; then
error "Please provide the full destination path for the credentials file including the filename"