Change the default notification exchange to glance

As we agreed that we'll change the default notification exchange name
from 'openstack' to 'glance' in M release.

The openstack convention is to send out all the notifications to the
exchange with the same name as the project name, i.e. nova sends all its
notifications to the exchange 'nova', cinder sends all its notifications
to the exchange 'cinder', etc. In such way, other projects interested in
those notifications (e.g. ceilometer) can listen on different exchanges
for different notifications.

Change-Id: I658fb0896aecea4fd5db1a9d3a8bbb64a91a7224
Closes-Bug: #1467776
This commit is contained in:
Lianhao Lu 2015-06-23 16:27:16 +08:00
parent e3b8753d27
commit 5b7b498f03
4 changed files with 13 additions and 0 deletions

View File

@ -73,6 +73,7 @@ def main():
config.parse_args()
wsgi.set_eventlet_hub()
logging.setup(CONF, 'glance')
notifier.set_defaults()
if cfg.CONF.profiler.enabled:
_notifier = osprofiler.notifier.create("Messaging",

View File

@ -58,6 +58,7 @@ def main():
config.parse_args()
wsgi.set_eventlet_hub()
logging.setup(CONF, 'glance')
notifier.set_defaults()
if cfg.CONF.profiler.enabled:
_notifier = osprofiler.notifier.create("Messaging",

View File

@ -59,6 +59,10 @@ _ALIASES = {
}
def set_defaults(control_exchange='glance'):
oslo_messaging.set_transport_defaults(control_exchange)
def get_transport():
return oslo_messaging.get_transport(CONF, aliases=_ALIASES)

View File

@ -114,6 +114,13 @@ class TestNotifier(utils.BaseTestCase):
def test_notifier_load(self):
self._test_load_strategy(url=None, driver=None)
@mock.patch.object(oslo_messaging, 'set_transport_defaults')
def test_set_defaults(self, mock_set_trans_defaults):
notifier.set_defaults(control_exchange='foo')
mock_set_trans_defaults.assert_called_with('foo')
notifier.set_defaults()
mock_set_trans_defaults.assert_called_with('glance')
class TestImageNotifications(utils.BaseTestCase):
"""Test Image Notifications work"""