Update driver config parameter from string to list
This patch set fixes a gating issue where the parameter passes into [oslo_messaging_notifications] driver is a string rather than a list. This causes the code to enumerate over the string when [audit_middleware_notifications] driver is set to None. Per [0], that parameter should be a list instead of a string. [0] https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/notify/notifier.py#L35 Change-Id: Iab92629b19f46aa3bff96aa6a22b5a609a4ff76e
This commit is contained in:
parent
08bf885ceb
commit
0382f7db00
@ -18,7 +18,8 @@ from keystonemiddleware.tests.unit.audit import base
|
||||
class AuditNotifierConfigTest(base.BaseAuditMiddlewareTest):
|
||||
|
||||
def test_conf_middleware_log_and_default_as_messaging(self):
|
||||
self.cfg.config(driver='log', group='audit_middleware_notifications')
|
||||
self.cfg.config(driver='log',
|
||||
group='audit_middleware_notifications')
|
||||
app = self.create_simple_app()
|
||||
with mock.patch('oslo_messaging.notify._impl_log.LogDriver.notify',
|
||||
side_effect=Exception('error')) as driver:
|
||||
@ -28,7 +29,7 @@ class AuditNotifierConfigTest(base.BaseAuditMiddlewareTest):
|
||||
self.assertTrue(driver.called)
|
||||
|
||||
def test_conf_middleware_log_and_oslo_msg_as_messaging(self):
|
||||
self.cfg.config(driver='messaging',
|
||||
self.cfg.config(driver=['messaging'],
|
||||
group='oslo_messaging_notifications')
|
||||
self.cfg.config(driver='log',
|
||||
group='audit_middleware_notifications')
|
||||
@ -42,7 +43,7 @@ class AuditNotifierConfigTest(base.BaseAuditMiddlewareTest):
|
||||
self.assertTrue(driver.called)
|
||||
|
||||
def test_conf_middleware_messaging_and_oslo_msg_as_log(self):
|
||||
self.cfg.config(driver='log', group='oslo_messaging_notifications')
|
||||
self.cfg.config(driver=['log'], group='oslo_messaging_notifications')
|
||||
self.cfg.config(driver='messaging',
|
||||
group='audit_middleware_notifications')
|
||||
app = self.create_simple_app()
|
||||
@ -55,7 +56,7 @@ class AuditNotifierConfigTest(base.BaseAuditMiddlewareTest):
|
||||
self.assertTrue(driver.called)
|
||||
|
||||
def test_with_no_middleware_notification_conf(self):
|
||||
self.cfg.config(driver='messaging',
|
||||
self.cfg.config(driver=['messaging'],
|
||||
group='oslo_messaging_notifications')
|
||||
self.cfg.config(driver=None, group='audit_middleware_notifications')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user