Return back devstack exercise to in-tree plugin

It'll be executed on the post devstack installation stage to ensure
sahara service running.

Change-Id: I299afd3382113b3b088f8feb87c40d5f632c62f1
This commit is contained in:
Sergey Lukjanov 2015-07-03 00:35:58 +03:00
parent 55f95a5d16
commit 46cac87733
1 changed files with 47 additions and 0 deletions

47
devstack/exercise.sh Normal file
View File

@ -0,0 +1,47 @@
#!/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
source $TOP_DIR/functions
# Import configuration
source $TOP_DIR/openrc
# Import exercise configuration
source $TOP_DIR/exerciserc
is_service_enabled sahara || exit 55
if is_ssl_enabled_service "sahara" || 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 "*********************************************************************"