Fix ignored KSA adapter options
KSA adapter options have been registered but these have been unused.
Fix the ignored adapter options so that a few important options such
as valid_interfaces work.
Note that we can't use the native oslo_conf argument because
the current behavior of Connection class attempts to load these adapter
options from the "keystone" section, while there are actually
registered in "oslo_limits" section.
This effectively reverts 4a3c10b58e
because the same functionality can be now achieved by
the valid_interface option.
Related-Bug: 2105987
Change-Id: I038b805be85b9b16c8a1a9eeaa1c90f8f413cc97
This commit is contained in:
@@ -40,9 +40,18 @@ def _get_keystone_connection():
|
|||||||
CONF, group='oslo_limit')
|
CONF, group='oslo_limit')
|
||||||
session = loading.load_session_from_conf_options(
|
session = loading.load_session_from_conf_options(
|
||||||
CONF, group='oslo_limit', auth=auth)
|
CONF, group='oslo_limit', auth=auth)
|
||||||
|
ksa_opts = loading.get_adapter_conf_options(
|
||||||
|
include_deprecated=False)
|
||||||
|
conn_kwargs = {}
|
||||||
|
for opt in ksa_opts:
|
||||||
|
if opt.dest != 'valid_interfaces':
|
||||||
|
conn_kwargs['identity_' + opt.dest] = getattr(
|
||||||
|
CONF.oslo_limit, opt.dest)
|
||||||
|
conn_kwargs['identity_interface'] = \
|
||||||
|
CONF.oslo_limit.valid_interfaces
|
||||||
_SDK_CONNECTION = connection.Connection(
|
_SDK_CONNECTION = connection.Connection(
|
||||||
session=session,
|
session=session,
|
||||||
interface=CONF.oslo_limit.interface
|
**conn_kwargs
|
||||||
).identity
|
).identity
|
||||||
except (ksa_exceptions.NoMatchingPlugin,
|
except (ksa_exceptions.NoMatchingPlugin,
|
||||||
ksa_exceptions.MissingRequiredOptions,
|
ksa_exceptions.MissingRequiredOptions,
|
||||||
|
@@ -43,11 +43,6 @@ _options = [
|
|||||||
choices=['public', 'publicURL', 'internal', 'internalURL',
|
choices=['public', 'publicURL', 'internal', 'internalURL',
|
||||||
'admin', 'adminURL'],
|
'admin', 'adminURL'],
|
||||||
help=_("The interface for endpoint discovery")),
|
help=_("The interface for endpoint discovery")),
|
||||||
cfg.StrOpt(
|
|
||||||
'interface',
|
|
||||||
default='public',
|
|
||||||
choices=['public', 'internal', 'admin'],
|
|
||||||
help=_("The interface used for communication with identity service.")),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
_option_group = 'oslo_limit'
|
_option_group = 'oslo_limit'
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
features:
|
|
||||||
- |
|
|
||||||
Added option ``interface`` to ``[oslo_limit]`` section, introducing ability
|
|
||||||
to select interface for communicating with identity service for obtaining
|
|
||||||
limits.
|
|
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fix ignored keystoneauth adapter options such as valid_interfaces.
|
||||||
|
|
Reference in New Issue
Block a user