@@ -145,6 +145,12 @@ SKIP_STOP_OVN=${SKIP_STOP_OVN:-False}
145145# /etc/neutron is assumed by many of devstack plugins. Do not change.
146146_Q_PLUGIN_EXTRA_CONF_PATH=/etc/neutron
147147
148+ # The name of the service in the endpoint URL
149+ NEUTRON_ENDPOINT_SERVICE_NAME=${NEUTRON_ENDPOINT_SERVICE_NAME-" networking" }
150+ if [[ " $NEUTRON_DEPLOY_MOD_WSGI " == " True" && -z " $NEUTRON_ENDPOINT_SERVICE_NAME " ]]; then
151+ NEUTRON_ENDPOINT_SERVICE_NAME=" networking"
152+ fi
153+
148154# List of config file names in addition to the main plugin config file
149155# To add additional plugin config files, use ``neutron_server_config_add``
150156# utility function. For example:
@@ -431,10 +437,13 @@ function create_nova_conf_neutron {
431437function create_mutnauq_accounts {
432438 local neutron_url
433439 if [ " $NEUTRON_DEPLOY_MOD_WSGI " == " True" ]; then
434- neutron_url=$Q_PROTOCOL ://$SERVICE_HOST /networking/
440+ neutron_url=$Q_PROTOCOL ://$SERVICE_HOST /
435441 else
436442 neutron_url=$Q_PROTOCOL ://$SERVICE_HOST :$Q_PORT /
437443 fi
444+ if [ ! -z " $NEUTRON_ENDPOINT_SERVICE_NAME " ]; then
445+ neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
446+ fi
438447
439448 if [[ " $ENABLED_SERVICES " =~ " q-svc" ]]; then
440449
@@ -538,17 +547,20 @@ function start_neutron_service_and_check {
538547 if [ " $NEUTRON_DEPLOY_MOD_WSGI " == " True" ]; then
539548 enable_service neutron-api
540549 run_process neutron-api " $( which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF "
541- neutron_url=$Q_PROTOCOL ://$Q_HOST /networking/
550+ neutron_url=$Q_PROTOCOL ://$Q_HOST /
542551 enable_service neutron-rpc-server
543552 run_process neutron-rpc-server " $NEUTRON_BIN_DIR /neutron-rpc-server $cfg_file_options "
544553 else
545554 run_process q-svc " $NEUTRON_BIN_DIR /neutron-server $cfg_file_options "
546- neutron_url=$service_protocol ://$Q_HOST :$service_port
555+ neutron_url=$service_protocol ://$Q_HOST :$service_port /
547556 # Start proxy if enabled
548557 if is_service_enabled tls-proxy; then
549558 start_tls_proxy neutron ' *' $Q_PORT $Q_HOST $Q_PORT_INT
550559 fi
551560 fi
561+ if [ ! -z " $NEUTRON_ENDPOINT_SERVICE_NAME " ]; then
562+ neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
563+ fi
552564 echo " Waiting for Neutron to start..."
553565
554566 local testcmd=" wget ${ssl_ca} --no-proxy -q -O- $neutron_url "
@@ -905,12 +917,25 @@ function _configure_neutron_plugin_agent {
905917 neutron_plugin_configure_plugin_agent
906918}
907919
920+ function _replace_api_paste_composite {
921+ local sep
922+ sep=$( echo -ne " \x01" )
923+ # Replace it
924+ $sudo sed -i -e " s/\/\: neutronversions_composite/\/" ${NEUTRON_ENDPOINT_SERVICE_NAME} " \/\: neutronversions_composite/" " $Q_API_PASTE_FILE "
925+ $sudo sed -i -e " s/\/healthcheck\: healthcheck/\/" ${NEUTRON_ENDPOINT_SERVICE_NAME} " \/healthcheck\: healthcheck/" " $Q_API_PASTE_FILE "
926+ $sudo sed -i -e " s/\/v2.0\: neutronapi_v2_0/\/" ${NEUTRON_ENDPOINT_SERVICE_NAME} " \/v2.0\: neutronapi_v2_0/" " $Q_API_PASTE_FILE "
927+ }
928+
908929# _configure_neutron_service() - Set config files for neutron service
909930# It is called when q-svc is enabled.
910931function _configure_neutron_service {
911932 Q_API_PASTE_FILE=$NEUTRON_CONF_DIR /api-paste.ini
912933 cp $NEUTRON_DIR /etc/api-paste.ini $Q_API_PASTE_FILE
913934
935+ if [[ -n " $NEUTRON_ENDPOINT_SERVICE_NAME " ]]; then
936+ _replace_api_paste_composite
937+ fi
938+
914939 # Update either configuration file with plugin
915940 iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
916941
0 commit comments