make the DHCP agent use a unique queue name
fixes bug: 1084621 This generates a unique name, so that multiple agents can be active within a deployment. Change-Id: Ia2bdc27866e6aa4aebd0bd28d1dfd25c3167dd03
This commit is contained in:
parent
bc3ff97870
commit
d0a284de2f
@ -24,6 +24,7 @@ from quantum.openstack.common.notifier import api
|
||||
from quantum.openstack.common.notifier import rpc_notifier
|
||||
from quantum.openstack.common import rpc
|
||||
from quantum.openstack.common.rpc import proxy
|
||||
from quantum.openstack.common import uuidutils
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -88,7 +89,9 @@ class NotificationDispatcher(object):
|
||||
self.connection = rpc.create_connection(new=True)
|
||||
topic = '%s.%s' % (rpc_notifier.CONF.notification_topics[0],
|
||||
api.CONF.default_notification_level.lower())
|
||||
queue_name = 'notification_listener_%s' % uuidutils.generate_uuid()
|
||||
self.connection.declare_topic_consumer(topic=topic,
|
||||
queue_name=queue_name,
|
||||
callback=self._add_to_queue)
|
||||
self.connection.consume_in_thread()
|
||||
|
||||
|
@ -82,6 +82,7 @@ class AgentRPCNotificationDispatcher(unittest.TestCase):
|
||||
expected = [
|
||||
mock.call(new=True),
|
||||
mock.call().declare_topic_consumer(topic='notifications.info',
|
||||
queue_name=mock.ANY,
|
||||
callback=nd._add_to_queue),
|
||||
mock.call().consume_in_thread()
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user