exercises/sahara.sh
a45a0a02
 #!/usr/bin/env bash
 
7ff8443e
 # **sahara.sh**
a45a0a02
 
7ff8443e
 # Sanity check that Sahara started if enabled
a45a0a02
 
 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
 
7ff8443e
 is_service_enabled sahara || exit 55
a45a0a02
 
7ff8443e
 curl http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
a45a0a02
 
 set +o xtrace
 echo "*********************************************************************"
 echo "SUCCESS: End DevStack Exercise: $0"
 echo "*********************************************************************"