From 16ad97c13fb296125a843d1dda31900994628727 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 6 Sep 2012 14:37:52 -0400 Subject: Make projects define 'control_exchange'. The 'control_exchange' option needs to have a project-specific default value. Just don't register this option and expect it to be registered by the project using this code, at least for now. ****** IMPORTANT NOTE WHEN IMPORTING THIS CHANGE ****** If you are importing this change into a project that uses rpc, you must add the control_exchange option in your code! ******************************************************* Change-Id: Ida5a8637c419e709bbf22fcad57b0f11c31bb959 --- openstack/common/rpc/impl_qpid.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'openstack/common/rpc/impl_qpid.py') diff --git a/openstack/common/rpc/impl_qpid.py b/openstack/common/rpc/impl_qpid.py index 992790a..93d771c 100644 --- a/openstack/common/rpc/impl_qpid.py +++ b/openstack/common/rpc/impl_qpid.py @@ -181,9 +181,8 @@ class TopicConsumer(ConsumerBase): """ super(TopicConsumer, self).__init__(session, callback, - "%s/%s" % (conf.control_exchange, - topic), - {}, name or topic, {}) + "%s/%s" % (rpc_amqp.get_control_exchange(conf), topic), + {}, name or topic, {}) class FanoutConsumer(ConsumerBase): @@ -256,9 +255,8 @@ class TopicPublisher(Publisher): def __init__(self, conf, session, topic): """init a 'topic' publisher. """ - super(TopicPublisher, self).__init__( - session, - "%s/%s" % (conf.control_exchange, topic)) + super(TopicPublisher, self).__init__(session, + "%s/%s" % (rpc_amqp.get_control_exchange(conf), topic)) class FanoutPublisher(Publisher): @@ -276,10 +274,9 @@ class NotifyPublisher(Publisher): def __init__(self, conf, session, topic): """init a 'topic' publisher. """ - super(NotifyPublisher, self).__init__( - session, - "%s/%s" % (conf.control_exchange, topic), - {"durable": True}) + super(NotifyPublisher, self).__init__(session, + "%s/%s" % (rpc_amqp.get_control_exchange(conf), topic), + {"durable": True}) class Connection(object): -- cgit