use local config options if available in audit middleware
Some services such as Swift does not use Oslo (global) config. In that case, make sure we can pass the options via local config instead. This is consistent with how auth_token middleware handle global and local config options. Change-Id: Ica7f1a4de2676549b2b65cca0181f2a911156ee6 Closes-Bug: 1583702
This commit is contained in:
parent
ed76943c92
commit
8859345f3b
@ -382,13 +382,13 @@ class AuditMiddleware(object):
|
|||||||
if messaging:
|
if messaging:
|
||||||
transport = oslo_messaging.get_transport(
|
transport = oslo_messaging.get_transport(
|
||||||
cfg.CONF,
|
cfg.CONF,
|
||||||
url=cfg.CONF.audit_middleware_notifications.transport_url,
|
url=self._conf.get('transport_url'),
|
||||||
aliases=transport_aliases)
|
aliases=transport_aliases)
|
||||||
self._notifier = oslo_messaging.Notifier(
|
self._notifier = oslo_messaging.Notifier(
|
||||||
transport,
|
transport,
|
||||||
os.path.basename(sys.argv[0]),
|
os.path.basename(sys.argv[0]),
|
||||||
driver=cfg.CONF.audit_middleware_notifications.driver,
|
driver=self._conf.get('driver'),
|
||||||
topics=cfg.CONF.audit_middleware_notifications.topics)
|
topics=self._conf.get('topics'))
|
||||||
|
|
||||||
def _emit_audit(self, context, event_type, payload):
|
def _emit_audit(self, context, event_type, payload):
|
||||||
"""Emit audit notification.
|
"""Emit audit notification.
|
||||||
|
8
releasenotes/notes/bug-1583702-a4469dc1556878b9.yaml
Normal file
8
releasenotes/notes/bug-1583702-a4469dc1556878b9.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- >
|
||||||
|
[`bug 1583702 <https://bugs.launchpad.net/keystonemiddleware/+bug/1583702>`_]
|
||||||
|
Some services such as Swift does not use Oslo (global) config. In that
|
||||||
|
case, the options are conveyed via local config. This patch utilized
|
||||||
|
an established pattern in auth_token middleware, which is to first
|
||||||
|
look for the given option in local config, then Oslo global config.
|
Loading…
x
Reference in New Issue
Block a user