Use new get_rpc_client API from oslo.messaging

Use the new API that is consistent with
the existing API instead of instantiating the client
class directly.

This was introduced in release 14.1.0 here [1] and
added into oslo.messaging here [2]

[1] https://review.opendev.org/c/openstack/requirements/+/869340
[2] https://review.opendev.org/c/openstack/oslo.messaging/+/862419

Change-Id: Ia0178e905654aaf0d05c7396867332ea5a661760
This commit is contained in:
Tobias Urdin 2023-01-19 20:45:49 +00:00 committed by wu.chunyang
parent ce5956d61a
commit 4b9c3d3079
2 changed files with 4 additions and 5 deletions

View File

@ -38,7 +38,7 @@ oslo.utils>=3.40.0 # Apache-2.0
oslo.concurrency>=3.26.0 # Apache-2.0
PyMySQL>=0.7.6 # MIT License
stevedore>=1.20.0 # Apache-2.0
oslo.messaging>=5.29.0 # Apache-2.0
oslo.messaging>=14.1.0 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.db>=4.27.0 # Apache-2.0

View File

@ -103,10 +103,9 @@ def get_client(target, key, version_cap=None, serializer=None,
# assert key is not None
serializer = secure_serializer(
sz.TroveRequestContextSerializer(serializer), key)
return messaging.RPCClient(TRANSPORT,
target,
version_cap=version_cap,
serializer=serializer)
return messaging.get_rpc_client(
TRANSPORT, target, version_cap=version_cap,
serializer=serializer)
def get_server(target, endpoints, key, serializer=None,