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]. But tacker
needs the 14.2.0 [3] version to override the client class.

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

Depends-On: https://review.opendev.org/c/openstack/oslo.messaging/+/869899
Depends-On: https://review.opendev.org/c/openstack/releases/+/872383
Change-Id: I0cfcd7a54cdb46b3c4d4128dfe4ec1df552976ab
This commit is contained in:
Tobias Urdin 2023-01-19 20:54:48 +00:00 committed by Yuta Kazato
parent 46a28fc8a2
commit b74c033337
2 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,7 @@ oslo.config>=6.8.0 # Apache-2.0
oslo.context>=2.22.0 # Apache-2.0 oslo.context>=2.22.0 # Apache-2.0
oslo.db>=5.0.0 # Apache-2.0 oslo.db>=5.0.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
oslo.messaging>=9.3.0 # Apache-2.0 oslo.messaging>=14.2.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0
oslo.policy>=3.6.0 # Apache-2.0 oslo.policy>=3.6.0 # Apache-2.0
oslo.privsep>=2.4.0 # Apache-2.0 oslo.privsep>=2.4.0 # Apache-2.0

View File

@ -197,10 +197,9 @@ class BackingOffClient(oslo_messaging.RPCClient):
def get_client(target, version_cap=None, serializer=None): def get_client(target, version_cap=None, serializer=None):
assert TRANSPORT is not None assert TRANSPORT is not None
serializer = RequestContextSerializer(serializer) serializer = RequestContextSerializer(serializer)
return BackingOffClient(TRANSPORT, return oslo_messaging.get_rpc_client(
target, TRANSPORT, target, version_cap=version_cap,
version_cap=version_cap, serializer=serializer, client_cls=BackingOffClient)
serializer=serializer)
def get_server(target, endpoints, serializer=None): def get_server(target, endpoints, serializer=None):