From 8ad62fe75188e934549047b7fd0ab5fd31194842 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 25 Sep 2016 01:29:40 +0000 Subject: [PATCH] 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 Neutron landed 3 months+ ago, so we can proceed ripping those aliases from the code base. [1] I314cefa5fb1803fa7e21e3e34300e5ced31bba89 Change-Id: I9e66140ad0b10c50e216c78e4914c98313cada05 Closes-Bug: #1424728 --- neutron/common/rpc.py | 16 ++-------------- neutron/tests/unit/common/test_rpc.py | 6 ++---- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/neutron/common/rpc.py b/neutron/common/rpc.py index 06357f7234a..bd1f2c1116f 100644 --- a/neutron/common/rpc.py +++ b/neutron/common/rpc.py @@ -46,17 +46,6 @@ ALLOWED_EXMODS = [ EXTRA_EXMODS = [] -TRANSPORT_ALIASES = { - 'neutron.openstack.common.rpc.impl_fake': 'fake', - 'neutron.openstack.common.rpc.impl_qpid': 'qpid', - 'neutron.openstack.common.rpc.impl_kombu': 'rabbit', - 'neutron.openstack.common.rpc.impl_zmq': 'zmq', - 'neutron.rpc.impl_fake': 'fake', - 'neutron.rpc.impl_qpid': 'qpid', - 'neutron.rpc.impl_kombu': 'rabbit', - 'neutron.rpc.impl_zmq': 'zmq', -} - # NOTE(salv-orlando): I am afraid this is a global variable. While not ideal, # they're however widely used throughout the code base. It should be set to # true if the RPC server is not running in the current process space. This @@ -68,10 +57,9 @@ def init(conf): global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER exmods = get_allowed_exmods() TRANSPORT = oslo_messaging.get_transport(conf, - allowed_remote_exmods=exmods, - aliases=TRANSPORT_ALIASES) + allowed_remote_exmods=exmods) NOTIFICATION_TRANSPORT = oslo_messaging.get_notification_transport( - conf, allowed_remote_exmods=exmods, aliases=TRANSPORT_ALIASES) + conf, allowed_remote_exmods=exmods) serializer = RequestContextSerializer() NOTIFIER = oslo_messaging.Notifier(NOTIFICATION_TRANSPORT, serializer=serializer) diff --git a/neutron/tests/unit/common/test_rpc.py b/neutron/tests/unit/common/test_rpc.py index ce024146cf7..35fab437825 100644 --- a/neutron/tests/unit/common/test_rpc.py +++ b/neutron/tests/unit/common/test_rpc.py @@ -74,11 +74,9 @@ class TestRPC(base.DietTestCase): rpc.init(conf) mock_exmods.assert_called_once_with() - mock_trans.assert_called_once_with(conf, allowed_remote_exmods=['foo'], - aliases=rpc.TRANSPORT_ALIASES) + mock_trans.assert_called_once_with(conf, allowed_remote_exmods=['foo']) mock_noti_trans.assert_called_once_with(conf, - allowed_remote_exmods=['foo'], - aliases=rpc.TRANSPORT_ALIASES) + allowed_remote_exmods=['foo']) mock_not.assert_called_once_with(noti_transport, serializer=serializer) self.assertIsNotNone(rpc.TRANSPORT)