Don't run and check c-api if it is disabled

Previously we didn't block out the c-api startup code because the
devstack functions to start services check that for us. However, since
the cinder devstack code checks the service is up and runs the tls proxy
if tls is enabled we need to block it all off to avoid doing those
things if c-api is disabled.

Change-Id: I1c4f22f785af96caaf4baa21ff28714b9afd3458
This commit is contained in:
Clark Boylan 2017-05-25 14:57:19 -07:00
parent f0442dd592
commit 2dfca047d9

View File

@ -512,17 +512,24 @@ function start_cinder {
fi
fi
if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then
enable_apache_site osapi-volume
restart_apache_server
tail_log c-api /var/log/$APACHE_NAME/c-api.log
else
run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
fi
if is_service_enabled c-api ; then
if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then
enable_apache_site osapi-volume
restart_apache_server
tail_log c-api /var/log/$APACHE_NAME/c-api.log
else
run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
fi
echo "Waiting for Cinder API to start..."
if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then
die $LINENO "c-api did not start"
echo "Waiting for Cinder API to start..."
if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then
die $LINENO "c-api did not start"
fi
# Start proxies if enabled
if is_service_enabled tls-proxy; then
start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
fi
fi
run_process c-sch "$CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
@ -532,11 +539,6 @@ function start_cinder {
# NOTE(jdg): For cinder, startup order matters. To ensure that repor_capabilities is received
# by the scheduler start the cinder-volume service last (or restart it) after the scheduler
# has started. This is a quick fix for lp bug/1189595
# Start proxies if enabled
if is_service_enabled c-api && is_service_enabled tls-proxy; then
start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
fi
}
# stop_cinder() - Stop running processes