Skip to content

Commit

Permalink
Remove hardcoded http in URL in sahara exercise script
Browse files Browse the repository at this point in the history
The script hardcoded http://$SERVICE_HOST/... which failed
when SSL or tls-proxy was enabled. Calculate the protocol
based on enabled services instead.

Change-Id: I192eeeafe7bf4dc5cbd382c505ffb9307651d78a
  • Loading branch information
rcritten committed Jun 8, 2015
1 parent 21b7e97 commit ce2d75d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exercises/sahara.sh
Expand Up @@ -35,7 +35,13 @@ source $TOP_DIR/exerciserc

is_service_enabled sahara || exit 55

$CURL_GET http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
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 "*********************************************************************"
Expand Down

0 comments on commit ce2d75d

Please sign in to comment.