diff options
author | Vipin Balachandran <vbala@vmware.com> | 2016-12-08 15:09:09 +0530 |
---|---|---|
committer | Vipin Balachandran <vbala@vmware.com> | 2016-12-08 15:31:22 +0530 |
commit | f8cd42d11d5a328386e8682fb2d58601309dbc86 (patch) | |
tree | bd25a1d7d68dad822aa9d41f3f05be54f29c1fb7 | |
parent | daf77e674b5b0bbc2c05fd7e6ef90edf1597c609 (diff) | |
download | osprofiler-f8cd42d11d5a328386e8682fb2d58601309dbc86.tar.gz |
Pass oslo.messaging kwargs only for "messaging://"
We need to pass oslo.messaging related arguments to
notifier.create() only if the connection string starts
with "messaging". Therefore removing those kwargs for
other connection strings.
Change-Id: Icb168ce6a456e5355aabbaf1283c30d3900a6ceb
-rw-r--r-- | osprofiler/initializer.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/osprofiler/initializer.py b/osprofiler/initializer.py index 37d70b2..2921f30 100644 --- a/osprofiler/initializer.py +++ b/osprofiler/initializer.py @@ -30,14 +30,17 @@ def init_from_conf(conf, context, project, service, host): running on. """ connection_str = conf.profiler.connection_string + kwargs = {} + if connection_str.startswith("messaging"): + kwargs = {"messaging": oslo_messaging, + "transport": oslo_messaging.get_transport(conf)} _notifier = notifier.create( connection_str, - messaging=oslo_messaging, context=context, - transport=oslo_messaging.get_transport(conf), project=project, service=service, host=host, - conf=conf) + conf=conf, + **kwargs) notifier.set(_notifier) web.enable(conf.profiler.hmac_keys) |