Added support of sahara with tls-proxy service

Now devstack will configure tls-proxy for sahara as well as for
other openstack services.

Change-Id: I7b0f2f0773cd3619a33cac66d40f3d0ce0f5432c
Closes-Bug: #1419163
This commit is contained in:
Andrew Lazarev 2015-02-09 16:51:25 -08:00
parent 5ccbd0ae0f
commit 0479d37878

View File

@ -33,11 +33,12 @@ SAHARA_DIR=$DEST/sahara
SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara} SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara}
SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf
if is_ssl_enabled_service "sahara"; then if is_ssl_enabled_service "sahara" || is_service_enabled tls-proxy; then
SAHARA_SERVICE_PROTOCOL="https" SAHARA_SERVICE_PROTOCOL="https"
fi fi
SAHARA_SERVICE_HOST=${SAHARA_SERVICE_HOST:-$SERVICE_HOST} SAHARA_SERVICE_HOST=${SAHARA_SERVICE_HOST:-$SERVICE_HOST}
SAHARA_SERVICE_PORT=${SAHARA_SERVICE_PORT:-8386} SAHARA_SERVICE_PORT=${SAHARA_SERVICE_PORT:-8386}
SAHARA_SERVICE_PORT_INT=${SAHARA_SERVICE_PORT_INT:-18386}
SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
SAHARA_AUTH_CACHE_DIR=${SAHARA_AUTH_CACHE_DIR:-/var/cache/sahara} SAHARA_AUTH_CACHE_DIR=${SAHARA_AUTH_CACHE_DIR:-/var/cache/sahara}
@ -183,6 +184,11 @@ function configure_sahara {
setup_colorized_logging $SAHARA_CONF_FILE DEFAULT setup_colorized_logging $SAHARA_CONF_FILE DEFAULT
fi fi
if is_service_enabled tls-proxy; then
# Set the service port for a proxy to take the original
iniset $SAHARA_CONF DEFAULT port $SAHARA_SERVICE_PORT_INT
fi
recreate_database sahara recreate_database sahara
$SAHARA_BIN_DIR/sahara-db-manage --config-file $SAHARA_CONF_FILE upgrade head $SAHARA_BIN_DIR/sahara-db-manage --config-file $SAHARA_CONF_FILE upgrade head
} }
@ -214,9 +220,26 @@ function sahara_register_images {
# start_sahara() - Start running processes, including screen # start_sahara() - Start running processes, including screen
function start_sahara { function start_sahara {
local service_port=$SAHARA_SERVICE_PORT
local service_protocol=$SAHARA_SERVICE_PROTOCOL
if is_service_enabled tls-proxy; then
service_port=$SAHARA_SERVICE_PORT_INT
service_protocol="http"
fi
run_process sahara "$SAHARA_BIN_DIR/sahara-all --config-file $SAHARA_CONF_FILE" run_process sahara "$SAHARA_BIN_DIR/sahara-all --config-file $SAHARA_CONF_FILE"
run_process sahara-api "$SAHARA_BIN_DIR/sahara-api --config-file $SAHARA_CONF_FILE" run_process sahara-api "$SAHARA_BIN_DIR/sahara-api --config-file $SAHARA_CONF_FILE"
run_process sahara-eng "$SAHARA_BIN_DIR/sahara-engine --config-file $SAHARA_CONF_FILE" run_process sahara-eng "$SAHARA_BIN_DIR/sahara-engine --config-file $SAHARA_CONF_FILE"
echo "Waiting for Sahara to start..."
if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$SAHARA_SERVICE_HOST:$service_port; then
die $LINENO "Sahara did not start"
fi
# Start proxies if enabled
if is_service_enabled tls-proxy; then
start_tls_proxy '*' $SAHARA_SERVICE_PORT $SAHARA_SERVICE_HOST $SAHARA_SERVICE_PORT_INT &
fi
} }
# stop_sahara() - Stop running processes # stop_sahara() - Stop running processes