From d0f5a9fdf51e70bcaed07733990de606a169ab27 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Cuong Date: Wed, 7 Jun 2017 09:52:05 +0700 Subject: [PATCH] Remove deprecated oslo_messaging.get_transport DeprecationWarning: Using function/method 'oslo_messaging.transport.get_transport()' is deprecated: use get_rpc_transport or get_notification_transport. Replace get_transport with get_rpc_transport. Change-Id: I13455842235a16463e61e5500c9e250a5cc9f86e --- watcher/common/rpc.py | 7 +++---- watcher/common/service.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/watcher/common/rpc.py b/watcher/common/rpc.py index c8aceeb05..49197a0ea 100644 --- a/watcher/common/rpc.py +++ b/watcher/common/rpc.py @@ -53,11 +53,10 @@ JsonPayloadSerializer = messaging.JsonPayloadSerializer def init(conf): global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER exmods = get_allowed_exmods() - TRANSPORT = messaging.get_transport(conf, - allowed_remote_exmods=exmods) + TRANSPORT = messaging.get_rpc_transport( + conf, allowed_remote_exmods=exmods) NOTIFICATION_TRANSPORT = messaging.get_notification_transport( - conf, - allowed_remote_exmods=exmods) + conf, allowed_remote_exmods=exmods) serializer = RequestContextSerializer(JsonPayloadSerializer()) if not conf.notification_level: diff --git a/watcher/common/service.py b/watcher/common/service.py index fda65c937..61bdd2ead 100644 --- a/watcher/common/service.py +++ b/watcher/common/service.py @@ -210,7 +210,7 @@ class Service(service.ServiceBase): @property def transport(self): if self._transport is None: - self._transport = om.get_transport(CONF) + self._transport = om.get_rpc_transport(CONF) return self._transport @property