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 Magnum landed 3 months+ ago, so we can proceed ripping
those aliases from the code base.

[1] I314cefa5fb1803fa7e21e3e34300e5ced31bba89

Closes-Bug: #1424728

Change-Id: I7c35f71f601f3191de4a97866d52db343e5735b1
changes/86/447286/2
ChangBo Guo(gcb) 6 years ago committed by ChangBo Guo(gcb)
parent 0c76374327
commit 31ee6a32b1
  1. 17
      magnum/common/rpc.py
  2. 14
      magnum/common/rpc_service.py
  3. 6
      magnum/tests/unit/common/test_rpc.py

@ -24,7 +24,6 @@ __all__ = [
'get_client',
'get_server',
'get_notifier',
'TRANSPORT_ALIASES',
]
import socket
@ -49,24 +48,12 @@ ALLOWED_EXMODS = [
]
EXTRA_EXMODS = []
# NOTE(lucasagomes): The magnum.openstack.common.rpc entries are for
# backwards compat with IceHouse rpc_backend configuration values.
TRANSPORT_ALIASES = {
'magnum.openstack.common.rpc.impl_kombu': 'rabbit',
'magnum.openstack.common.rpc.impl_qpid': 'qpid',
'magnum.openstack.common.rpc.impl_zmq': 'zmq',
'magnum.rpc.impl_kombu': 'rabbit',
'magnum.rpc.impl_qpid': 'qpid',
'magnum.rpc.impl_zmq': 'zmq',
}
def init(conf):
global TRANSPORT, NOTIFIER
exmods = get_allowed_exmods()
TRANSPORT = messaging.get_transport(conf,
allowed_remote_exmods=exmods,
aliases=TRANSPORT_ALIASES)
allowed_remote_exmods=exmods)
serializer = RequestContextSerializer(JsonPayloadSerializer())
NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer)
@ -149,7 +136,7 @@ class ProfilerRequestContextSerializer(RequestContextSerializer):
def get_transport_url(url_str=None):
return messaging.TransportURL.parse(CONF, url_str, TRANSPORT_ALIASES)
return messaging.TransportURL.parse(CONF, url_str)
def get_client(target, version_cap=None, serializer=None, timeout=None):

@ -25,14 +25,6 @@ from magnum.objects import base as objects_base
from magnum.service import periodic
from magnum.servicegroup import magnum_service_periodic as servicegroup
# NOTE(asalkeld):
# The magnum.openstack.common.rpc entries are for compatibility
# with devstack rpc_backend configuration values.
TRANSPORT_ALIASES = {
'magnum.openstack.common.rpc.impl_kombu': 'rabbit',
'magnum.openstack.common.rpc.impl_qpid': 'qpid',
'magnum.openstack.common.rpc.impl_zmq': 'zmq',
}
osprofiler = importutils.try_import("osprofiler.profiler")
@ -54,8 +46,7 @@ class Service(service.Service):
def __init__(self, topic, server, handlers, binary):
super(Service, self).__init__()
serializer = _init_serializer()
transport = messaging.get_transport(CONF,
aliases=TRANSPORT_ALIASES)
transport = messaging.get_transport(CONF)
# TODO(asalkeld) add support for version='x.y'
target = messaging.Target(topic=topic, server=server)
self._server = messaging.get_rpc_server(transport, target, handlers,
@ -89,8 +80,7 @@ class API(object):
if transport is None:
exmods = rpc.get_allowed_exmods()
transport = messaging.get_transport(CONF,
allowed_remote_exmods=exmods,
aliases=TRANSPORT_ALIASES)
allowed_remote_exmods=exmods)
self._context = context
if topic is None:
topic = ''

@ -106,8 +106,7 @@ class TestRpc(base.TestCase):
url = rpc.get_transport_url(url_str='bar')
self.assertEqual('foo', url)
mock_url.parse.assert_called_once_with(conf, 'bar',
rpc.TRANSPORT_ALIASES)
mock_url.parse.assert_called_once_with(conf, 'bar')
@mock.patch.object(messaging, 'TransportURL')
def test_get_transport_url_null(self, mock_url):
@ -118,8 +117,7 @@ class TestRpc(base.TestCase):
url = rpc.get_transport_url()
self.assertEqual('foo', url)
mock_url.parse.assert_called_once_with(conf, None,
rpc.TRANSPORT_ALIASES)
mock_url.parse.assert_called_once_with(conf, None)
def test_cleanup_transport_null(self):
rpc.TRANSPORT = None

Loading…
Cancel
Save