Skip to content
Snippets Groups Projects
Commit 887a3693 authored by František Řezníček's avatar František Řezníček
Browse files

feat: show what ostack openrc was loaded

parent e5cc7a3a
Branches master
Tags v1.9.4
No related merge requests found
Pipeline #435807 passed
...@@ -14,6 +14,8 @@ SCRIPT_DIR=$(dirname $(readlink -f $0)) ...@@ -14,6 +14,8 @@ SCRIPT_DIR=$(dirname $(readlink -f $0))
source "${SCRIPT_DIR}/lib.sh.inc" source "${SCRIPT_DIR}/lib.sh.inc"
cd "${WORKDIR}/dask-distributed-2t-infra/example"
if [ "${OPERATION}" == "shell" ]; then if [ "${OPERATION}" == "shell" ]; then
bash bash
elif [ "${OPERATION}" == "cloud-connect" ]; then elif [ "${OPERATION}" == "cloud-connect" ]; then
...@@ -21,7 +23,6 @@ elif [ "${OPERATION}" == "cloud-connect" ]; then ...@@ -21,7 +23,6 @@ elif [ "${OPERATION}" == "cloud-connect" ]; then
ostack_cloud_connect ostack_cloud_connect
elif [ "${OPERATION}" == "infra-deploy" -o "${OPERATION}" == "infra-destroy" ]; then elif [ "${OPERATION}" == "infra-deploy" -o "${OPERATION}" == "infra-destroy" ]; then
pushd "${WORKDIR}/dask-distributed-2t-infra/example"
source_if_exists ${OPENSTACK_RC_FILES} source_if_exists ${OPENSTACK_RC_FILES}
ostack_cloud_connect ostack_cloud_connect
project_type=group project_type=group
...@@ -42,4 +43,3 @@ else ...@@ -42,4 +43,3 @@ else
logerr "ERROR: Invalid operation (${OPERATION})" logerr "ERROR: Invalid operation (${OPERATION})"
exit 2 exit 2
fi fi
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
# variables # variables
############################################################################# #############################################################################
OPENSTACK_BIN="${OPENSTACK_BIN:-openstack}" OPENSTACK_BIN="${OPENSTACK_BIN:-openstack}"
OPENSTACK_RC_FILES="${OPENSTACK_RC_FILES=:-"./project-openrc.sh ../project-openrc.sh"}" OPENSTACK_RC_FILES="${OPENSTACK_RC_FILES:-"./project-openrc.sh ../project-openrc.sh"}"
WORKDIR="/workdir" WORKDIR="/workdir"
[[ "${DEBUG}" =~ ^1|true|True$ ]] && set -x
############################################################################# #############################################################################
# functions # functions
############################################################################# #############################################################################
...@@ -32,8 +34,12 @@ function get_container_engine() { ...@@ -32,8 +34,12 @@ function get_container_engine() {
function source_if_exists() { function source_if_exists() {
for i_file in "$@"; do for i_file in "$@"; do
[ -f "${i_file}" -a -r "${i_file}" ] && \ if [ -f "${i_file}" -a -r "${i_file}" ]; then
source "${i_file}" source "${i_file}"
log "INFO: ${i_file} successfully loaded."
else
logerr "WARNING: ${i_file} not found."
fi
done done
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment