Merge "fix: specify endpoint info. for neutron client"

This commit is contained in:
Zuul 2024-03-08 09:14:52 +00:00 committed by Gerrit Code Review
commit a26c452f6f
2 changed files with 17 additions and 2 deletions

View File

@ -79,11 +79,22 @@ class NeutronAuth(object):
ksession = keystone.KeystoneSession('neutron') ksession = keystone.KeystoneSession('neutron')
if not cls.neutron_client: if not cls.neutron_client:
sess = ksession.get_session() sess = ksession.get_session()
kwargs = {'region_name': CONF.neutron.region_name}
kwargs = {} # TODO(ricolin) `interface` option don't take list as option yet.
# We can move away from this when openstacksdk no longer depends
# on `interface`.
try:
interface = CONF.neutron.valid_interfaces[0]
except (TypeError, LookupError):
interface = CONF.neutron.valid_interfaces
if interface:
kwargs['interface'] = interface
if CONF.neutron.endpoint_override: if CONF.neutron.endpoint_override:
kwargs['network_endpoint_override'] = ( kwargs['network_endpoint_override'] = (
CONF.neutron.endpoint_override) CONF.neutron.endpoint_override)
if CONF.neutron.endpoint_override.startswith("https"):
kwargs['insecure'] = CONF.neutron.insecure
kwargs['cacert'] = CONF.neutron.cafile
conn = openstack.connection.Connection( conn = openstack.connection.Connection(
session=sess, **kwargs) session=sess, **kwargs)

View File

@ -0,0 +1,4 @@
---
fixes:
- |
Fixed wrong endpoint information in neutron client configuration.