diff options
author | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-08 08:03:55 +0000 |
---|---|---|
committer | Mehdi Abaakouk <sileht@redhat.com> | 2015-12-08 16:01:49 +0100 |
commit | 050024f7984397010c38cbfb8626112d33cbec43 (patch) | |
tree | 00137c429804192bcd931b0f5676a1fea520f87b | |
parent | 52ccff7cbc26af0738d7a0a7d6e99330421b61d1 (diff) | |
download | oslo-messaging-050024f7984397010c38cbfb8626112d33cbec43.tar.gz |
Fix notifier options registration
Change-Id: I37082f6f349e89af6b74e6ec5e5c416902299263
-rw-r--r-- | oslo_messaging/notify/notifier.py | 4 | ||||
-rwxr-xr-x | tools/simulator.py | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/oslo_messaging/notify/notifier.py b/oslo_messaging/notify/notifier.py index fb84164..cc4f2eb 100644 --- a/oslo_messaging/notify/notifier.py +++ b/oslo_messaging/notify/notifier.py @@ -90,9 +90,9 @@ class Driver(object): def get_notification_transport(conf, url=None, allowed_remote_exmods=None, aliases=None): + conf.register_opts(_notifier_opts, + group='oslo_messaging_notifications') if url is None: - conf.register_opts(_notifier_opts, - group='oslo_messaging_notifications') url = conf.oslo_messaging_notifications.transport_url return msg_transport.get_transport(conf, url, allowed_remote_exmods, aliases) diff --git a/tools/simulator.py b/tools/simulator.py index 3c587d5..03afe08 100755 --- a/tools/simulator.py +++ b/tools/simulator.py @@ -281,16 +281,20 @@ def main(): _setup_logging(is_debug=args.debug) + if args.mode in ['rpc-server', 'rpc-client']: + transport = messaging.get_transport(cfg.CONF, url=args.url) + else: + transport = messaging.get_notification_transport(cfg.CONF, + url=args.url) + cfg.CONF.oslo_messaging_notifications.topics = "notif" + cfg.CONF.oslo_messaging_notifications.driver = "messaging" + target = messaging.Target(topic=args.topic, server='profiler_server') + # oslo.config defaults cfg.CONF.heartbeat_interval = 5 - cfg.CONF.oslo_messaging_notifications.topics = "notif" - cfg.CONF.oslo_messaging_notifications.driver = "messaging" cfg.CONF.prog = os.path.basename(__file__) cfg.CONF.project = 'oslo.messaging' - transport = messaging.get_transport(cfg.CONF, url=args.url) - target = messaging.Target(topic=args.topic, server='profiler_server') - if args.mode == 'rpc-server': if args.url.startswith('zmq'): cfg.CONF.rpc_zmq_matchmaker = "redis" |