Remove old oslo.messaging transport aliases

Those are remnants from the oslo-incubator times. Also, oslo.messaging
deprecated [1] transport aliases since 5.2.0+ that is the minimal
version supported for stable/newton. The patch that bumped the minimal
version for Sahara landed 3 months+ ago, so we can proceed ripping
those aliases from the code base.

[1] I314cefa5fb1803fa7e21e3e34300e5ced31bba89

Closes-Bug: #1424728

Change-Id: I02fbe5f4f9f3bda80f4fc1ea94f852e1969ce1aa
This commit is contained in:
ChangBo Guo(gcb) 2017-03-19 20:47:33 +08:00
parent bd9dc1a21c
commit c5b3f82651
2 changed files with 6 additions and 18 deletions

View File

@ -19,12 +19,6 @@ from sahara import main
from sahara.tests.unit import base
from sahara.utils import rpc as messaging
_ALIASES = {
'sahara.openstack.common.rpc.impl_kombu': 'rabbit',
'sahara.openstack.common.rpc.impl_qpid': 'qpid',
'sahara.openstack.common.rpc.impl_zmq': 'zmq',
}
class TestMessagingSetup(base.SaharaTestCase):
def setUp(self):
@ -67,10 +61,10 @@ class TestMessagingSetup(base.SaharaTestCase):
]
self.assertEqual(expected, self.set_transport_def.call_args_list)
self.assertEqual(
[mock.call(main.CONF, aliases=_ALIASES)],
[mock.call(main.CONF)],
self.get_transport.call_args_list)
self.assertEqual(
[mock.call(main.CONF, aliases=_ALIASES)],
[mock.call(main.CONF)],
self.get_notify_transport.call_args_list)
self.assertEqual(1, self.notifier_init.call_count)
@ -89,10 +83,10 @@ class TestMessagingSetup(base.SaharaTestCase):
]
self.assertEqual(expected, self.set_transport_def.call_args_list)
self.assertEqual(
[mock.call(main.CONF, aliases=_ALIASES)],
[mock.call(main.CONF)],
self.get_transport.call_args_list)
self.assertEqual(
[mock.call(main.CONF, aliases=_ALIASES)],
[mock.call(main.CONF)],
self.get_notify_transport.call_args_list)
self.assertEqual(1, self.notifier_init.call_count)

View File

@ -31,12 +31,6 @@ NOTIFIER = None
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
_ALIASES = {
'sahara.openstack.common.rpc.impl_kombu': 'rabbit',
'sahara.openstack.common.rpc.impl_qpid': 'qpid',
'sahara.openstack.common.rpc.impl_zmq': 'zmq',
}
class ContextSerializer(messaging.Serializer):
def __init__(self, base):
@ -102,14 +96,14 @@ def setup_service_messaging():
if MESSAGING_TRANSPORT:
# Already is up
return
MESSAGING_TRANSPORT = messaging.get_transport(cfg.CONF, aliases=_ALIASES)
MESSAGING_TRANSPORT = messaging.get_transport(cfg.CONF)
def setup_notifications():
global NOTIFICATION_TRANSPORT, NOTIFIER, MESSAGING_TRANSPORT
try:
NOTIFICATION_TRANSPORT = \
messaging.get_notification_transport(cfg.CONF, aliases=_ALIASES)
messaging.get_notification_transport(cfg.CONF)
except Exception:
LOG.error(_LE("Unable to setup notification transport. Reusing "
"service transport for that."))