Fix neutron subnet lookup ignoring endpoint_type

The recent patch[1] that adds a neutron subnet lookup using the user
context is not honoring the interface/endpoint_type or region_name
settings for neutron in the octavia configuration file.
This is causing problems for deployments that use the "internal"
endpoint for neutron and the current code will always return
the "public" endpoint.
This patch corrects this problem by including those filter
parameters when the neutron endpoint is looked up in keystone.

[1] https://review.opendev.org/726042

Change-Id: I7b8f7c7d653b37395f9a660be67f954a3a6f26d9
Story: 2007863
Task: 40173
(cherry picked from commit 40731e572f)
This commit is contained in:
Michael Johnson 2020-06-25 10:05:54 -07:00
parent eb14c5acdf
commit 2a18b6cc99
1 changed files with 3 additions and 1 deletions

View File

@ -120,7 +120,9 @@ class NeutronAuth(object):
neutron_endpoint = CONF.neutron.endpoint
if not neutron_endpoint:
session = keystone.KeystoneSession().get_session()
endpoint_data = session.get_endpoint_data(service_type='network')
endpoint_data = session.get_endpoint_data(
service_type='network', interface=CONF.neutron.endpoint_type,
region_name=CONF.neutron.region_name)
neutron_endpoint = endpoint_data.catalog_url
kwargs = {