Merge "Remove old oslo.messaging transport aliases"
This commit is contained in:
commit
1f2f002c52
@ -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…
Reference in New Issue
Block a user