From 9ca7359bfdef609ac1a40b20f57273a929d33cf7 Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Tue, 9 Oct 2018 13:46:00 -0400 Subject: [PATCH] Allow transport_url initialization in ConfFixture constructor Change-Id: Ibe2a5277cdcf89cd006507f13eddbbec4b384681 --- oslo_messaging/conffixture.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oslo_messaging/conffixture.py b/oslo_messaging/conffixture.py index 6a4c4660c..78c73b653 100644 --- a/oslo_messaging/conffixture.py +++ b/oslo_messaging/conffixture.py @@ -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