| Nikhil Manchanda | 0cccad4 | 2012-12-03 18:15:09 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash | 
 | 2 |  | 
 | 3 | # **trove.sh** | 
 | 4 |  | 
 | 5 | # Sanity check that trove started if enabled | 
 | 6 |  | 
 | 7 | echo "*********************************************************************" | 
 | 8 | echo "Begin DevStack Exercise: $0" | 
 | 9 | echo "*********************************************************************" | 
 | 10 |  | 
 | 11 | # This script exits on an error so that errors don't compound and you see | 
 | 12 | # only the first error that occurred. | 
 | 13 | set -o errexit | 
 | 14 |  | 
 | 15 | # Print the commands being run so that we can see the command that triggers | 
 | 16 | # an error.  It is also useful for following allowing as the install occurs. | 
 | 17 | set -o xtrace | 
 | 18 |  | 
 | 19 |  | 
 | 20 | # Settings | 
 | 21 | # ======== | 
 | 22 |  | 
 | 23 | # Keep track of the current directory | 
 | 24 | EXERCISE_DIR=$(cd $(dirname "$0") && pwd) | 
 | 25 | TOP_DIR=$(cd $EXERCISE_DIR/..; pwd) | 
 | 26 |  | 
 | 27 | # Import common functions | 
 | 28 | source $TOP_DIR/functions | 
 | 29 |  | 
 | 30 | # Import configuration | 
 | 31 | source $TOP_DIR/openrc | 
 | 32 |  | 
 | 33 | # Import exercise configuration | 
 | 34 | source $TOP_DIR/exerciserc | 
 | 35 |  | 
 | 36 | is_service_enabled trove || exit 55 | 
 | 37 |  | 
| Denis Makogon | 3e57427 | 2014-07-23 14:36:20 +0300 | [diff] [blame] | 38 | # can try to get datastore id | 
 | 39 | DSTORE_ID=$(trove datastore-list | tail -n +4 |head -3 | get_field 1) | 
 | 40 | die_if_not_set $LINENO  DSTORE_ID "Trove API not functioning!" | 
 | 41 |  | 
 | 42 | DV_ID=$(trove datastore-version-list $DSTORE_ID | tail -n +4 | get_field 1) | 
 | 43 | die_if_not_set $LINENO DV_ID "Trove API not functioning!" | 
| Nikhil Manchanda | 0cccad4 | 2012-12-03 18:15:09 -0700 | [diff] [blame] | 44 |  | 
 | 45 | set +o xtrace | 
 | 46 | echo "*********************************************************************" | 
 | 47 | echo "SUCCESS: End DevStack Exercise: $0" | 
 | 48 | echo "*********************************************************************" | 
 | 49 |  |