Change the glance_api_servers to adapt glance started with uwsgi

If deploying glance api servers under uwsgi mode, the endpoint won't
include port in its url. That will broken gate if we config the glance
api url including port.

Change-Id: Id610d6fd3482e6281f498300b3cde7cd45b017bc
Closes-Bug: #1699542
This commit is contained in:
liusheng 2017-06-27 14:05:04 +08:00
parent 8bef993e0c
commit f4ca7840c8

View File

@ -88,7 +88,12 @@ function configure_mogan {
iniset ${MOGAN_CONF_FILE} neutron url "${NEUTRON_SERVICE_PROTOCOL}://${SERVICE_HOST}:${NEUTRON_SERVICE_PORT}"
# Setup glance section
iniset ${MOGAN_CONF_FILE} glance glance_api_servers "${GLANCE_SERVICE_PROTOCOL}://${SERVICE_HOST}:${GLANCE_SERVICE_PORT}"
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
glance_url="$GLANCE_SERVICE_PROTOCOL://$GLANCE_SERVICE_HOST/image"
else
glance_url="$GLANCE_SERVICE_PROTOCOL://${SERVICE_HOST}:$GLANCE_HOSTPORT"
fi
iniset ${MOGAN_CONF_FILE} glance glance_api_servers ${glance_url}
# Setup keystone section
iniset ${MOGAN_CONF_FILE} keystone region_name ${REGION_NAME}