Merge "Use new get_rpc_client API from oslo.messaging"

This commit is contained in:
Zuul 2023-02-28 15:35:53 +00:00 committed by Gerrit Code Review
commit 21749a7dbc
4 changed files with 8 additions and 10 deletions

View File

@ -176,11 +176,10 @@ class AmphoraUpdateController(base.BaseController):
else: else:
topic = constants.TOPIC_AMPHORA_V2 topic = constants.TOPIC_AMPHORA_V2
version = "2.0" version = "2.0"
self.transport = messaging.get_rpc_transport(cfg.CONF)
self.target = messaging.Target( self.target = messaging.Target(
namespace=constants.RPC_NAMESPACE_CONTROLLER_AGENT, namespace=constants.RPC_NAMESPACE_CONTROLLER_AGENT,
topic=topic, version=version, fanout=False) topic=topic, version=version, fanout=False)
self.client = messaging.RPCClient(self.transport, target=self.target) self.client = rpc.get_client(self.target)
self.amp_id = amp_id self.amp_id = amp_id
@wsme_pecan.wsexpose(None, wtypes.text, status_code=202) @wsme_pecan.wsexpose(None, wtypes.text, status_code=202)

View File

@ -47,9 +47,8 @@ def get_client(target, version_cap=None, serializer=None,
assert TRANSPORT is not None, _("'TRANSPORT' must not be None") assert TRANSPORT is not None, _("'TRANSPORT' must not be None")
return messaging.RPCClient(TRANSPORT, return messaging.get_rpc_client(
target, TRANSPORT, target, version_cap=version_cap,
version_cap=version_cap,
serializer=serializer, serializer=serializer,
call_monitor_timeout=call_monitor_timeout) call_monitor_timeout=call_monitor_timeout)

View File

@ -1040,7 +1040,7 @@ class TestLoadBalancer(base.BaseAPITest):
".get_network") as mock_get_network, mock.patch( ".get_network") as mock_get_network, mock.patch(
'oslo_messaging.get_rpc_transport'), mock.patch( 'oslo_messaging.get_rpc_transport'), mock.patch(
'oslo_messaging.Target'), mock.patch( 'oslo_messaging.Target'), mock.patch(
'oslo_messaging.RPCClient'): 'oslo_messaging.get_rpc_client'):
mock_get_network.return_value = mock.MagicMock() mock_get_network.return_value = mock.MagicMock()
mock_get_network.return_value.port_security_enabled = True mock_get_network.return_value.port_security_enabled = True
response = self.post(self.LBS_PATH, body) response = self.post(self.LBS_PATH, body)
@ -1061,7 +1061,7 @@ class TestLoadBalancer(base.BaseAPITest):
".get_network") as mock_get_network, mock.patch( ".get_network") as mock_get_network, mock.patch(
'oslo_messaging.get_rpc_transport'), mock.patch( 'oslo_messaging.get_rpc_transport'), mock.patch(
'oslo_messaging.Target'), mock.patch( 'oslo_messaging.Target'), mock.patch(
'oslo_messaging.RPCClient'): 'oslo_messaging.get_rpc_client'):
mock_get_network.return_value = mock.MagicMock() mock_get_network.return_value = mock.MagicMock()
mock_get_network.return_value.port_security_enabled = False mock_get_network.return_value.port_security_enabled = False
response = self.post(self.LBS_PATH, body, status=500) response = self.post(self.LBS_PATH, body, status=500)

View File

@ -24,7 +24,7 @@ oslo.context>=2.22.0 # Apache-2.0
oslo.db[mysql]>=8.4.0 # Apache-2.0 oslo.db[mysql]>=8.4.0 # Apache-2.0
oslo.i18n>=3.20.0 # Apache-2.0 oslo.i18n>=3.20.0 # Apache-2.0
oslo.log>=4.3.0 # Apache-2.0 oslo.log>=4.3.0 # Apache-2.0
oslo.messaging>=12.4.0 # Apache-2.0 oslo.messaging>=14.1.0 # Apache-2.0
oslo.middleware>=4.0.1 # Apache-2.0 oslo.middleware>=4.0.1 # Apache-2.0
oslo.policy>=3.7.0 # Apache-2.0 oslo.policy>=3.7.0 # Apache-2.0
oslo.reports>=1.18.0 # Apache-2.0 oslo.reports>=1.18.0 # Apache-2.0