f580f0e713
Code conventions: Use “.” to source script files When you have to source a script file, for example , a credentials file to gain access to user-only or admin-only CLI commands, use . instead of source. See more: http://docs.openstack.org/contributor-guide/writing-style/code-conventions Change-Id: Icaf20628e7b7480ee4ca4c85f9c5a3802b817070
51 lines
1.4 KiB
Bash
51 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Sanity check that Sahara started if enabled
|
|
|
|
echo "*********************************************************************"
|
|
echo "Begin DevStack Exercise: $0"
|
|
echo "*********************************************************************"
|
|
|
|
# This script exits on an error so that errors don't compound and you see
|
|
# only the first error that occurred.
|
|
set -o errexit
|
|
|
|
# Print the commands being run so that we can see the command that triggers
|
|
# an error. It is also useful for following allowing as the install occurs.
|
|
set -o xtrace
|
|
|
|
|
|
# Settings
|
|
# ========
|
|
|
|
# Keep track of the current directory
|
|
EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
|
|
TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
|
|
|
|
# Import common functions
|
|
. $TOP_DIR/functions
|
|
|
|
# Import configuration
|
|
. $TOP_DIR/openrc
|
|
|
|
# Import exercise configuration
|
|
. $TOP_DIR/exerciserc
|
|
|
|
is_service_enabled sahara || exit 55
|
|
|
|
if is_ssl_enabled_service "sahara" ||\
|
|
is_ssl_enabled_service "sahara-api" ||\
|
|
is_service_enabled tls-proxy; then
|
|
SAHARA_SERVICE_PROTOCOL="https"
|
|
fi
|
|
|
|
SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
|
|
|
$CURL_GET $SAHARA_SERVICE_PROTOCOL://$SERVICE_HOST:8386/ 2>/dev/null \
|
|
| grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
|
|
|
|
set +o xtrace
|
|
echo "*********************************************************************"
|
|
echo "SUCCESS: End DevStack Exercise: $0"
|
|
echo "*********************************************************************"
|