Allow transport_url initialization in ConfFixture constructor

Change-Id: Ibe2a5277cdcf89cd006507f13eddbbec4b384681
This commit is contained in:
Kenneth Giusti 2018-10-09 13:46:00 -04:00
parent 16fea5b368
commit 9ca7359bfd

View File

@ -41,9 +41,11 @@ class ConfFixture(fixtures.Fixture):
:param conf: a ConfigOpts instance
:type conf: oslo.config.cfg.ConfigOpts
:param transport_url: override default transport_url value
:type transport_url: str
"""
def __init__(self, conf):
def __init__(self, conf, transport_url=None):
self.conf = conf
_import_opts(self.conf,
'oslo_messaging._drivers.impl_rabbit', 'rabbit_opts',
@ -64,6 +66,9 @@ class ConfFixture(fixtures.Fixture):
'_notifier_opts',
'oslo_messaging_notifications')
if transport_url is not None:
self.transport_url = transport_url
def _setup_decorator(self):
# Support older test cases that still use the set_override
# with the old config key names