Use get_rpc_transport instead of get_transport
With the added get_rpc_transport() function in oslo.messaging [1] and the recent version bump of oslo.messaging to 5.24.2, we can safely replace get_transport() with get_rpc_transport() which is much cleaner. [1] https://review.openstack.org/#/c/454194/ Change-Id: I460bdcae7855cae189d9b61896b5ef78989a197e
This commit is contained in:
@@ -59,9 +59,8 @@ TRANSPORT_ALIASES = {
|
|||||||
def init(conf):
|
def init(conf):
|
||||||
global TRANSPORT, NOTIFIER
|
global TRANSPORT, NOTIFIER
|
||||||
exmods = get_allowed_exmods()
|
exmods = get_allowed_exmods()
|
||||||
TRANSPORT = messaging.get_transport(conf,
|
TRANSPORT = messaging.get_rpc_transport(conf,
|
||||||
allowed_remote_exmods=exmods,
|
allowed_remote_exmods=exmods)
|
||||||
aliases=TRANSPORT_ALIASES)
|
|
||||||
serializer = RequestContextSerializer(JsonPayloadSerializer())
|
serializer = RequestContextSerializer(JsonPayloadSerializer())
|
||||||
NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer)
|
NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer)
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@ class Service(object):
|
|||||||
def __init__(self, topic, server, handlers):
|
def __init__(self, topic, server, handlers):
|
||||||
serializer = RequestContextSerializer(
|
serializer = RequestContextSerializer(
|
||||||
objects_base.CloudpulseObjectSerializer())
|
objects_base.CloudpulseObjectSerializer())
|
||||||
transport = messaging.get_transport(cfg.CONF,
|
transport = messaging.get_rpc_transport(cfg.CONF,
|
||||||
aliases=TRANSPORT_ALIASES)
|
aliases=TRANSPORT_ALIASES)
|
||||||
# TODO(asalkeld) add support for version='x.y'
|
# TODO(asalkeld) add support for version='x.y'
|
||||||
target = messaging.Target(topic=topic, server=server)
|
target = messaging.Target(topic=topic, server=server)
|
||||||
@@ -87,9 +87,8 @@ class API(object):
|
|||||||
objects_base.CloudpulseObjectSerializer())
|
objects_base.CloudpulseObjectSerializer())
|
||||||
if transport is None:
|
if transport is None:
|
||||||
exmods = rpc.get_allowed_exmods()
|
exmods = rpc.get_allowed_exmods()
|
||||||
transport = messaging.get_transport(cfg.CONF,
|
transport = messaging.get_rpc_transport(
|
||||||
allowed_remote_exmods=exmods,
|
cfg.CONF, allowed_remote_exmods=exmods)
|
||||||
aliases=TRANSPORT_ALIASES)
|
|
||||||
self._context = context
|
self._context = context
|
||||||
if topic is None:
|
if topic is None:
|
||||||
topic = ''
|
topic = ''
|
||||||
|
Reference in New Issue
Block a user