diff --git a/masakari/rpc.py b/masakari/rpc.py index 0ea34807..a2b8fdca 100644 --- a/masakari/rpc.py +++ b/masakari/rpc.py @@ -132,10 +132,9 @@ class RequestContextSerializer(messaging.Serializer): def get_client(target, version_cap=None, serializer=None): assert TRANSPORT is not None serializer = RequestContextSerializer(serializer) - 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, serializer=None): diff --git a/masakari/tests/unit/test_rpc.py b/masakari/tests/unit/test_rpc.py index 3ce35460..d8cf59e5 100644 --- a/masakari/tests/unit/test_rpc.py +++ b/masakari/tests/unit/test_rpc.py @@ -87,20 +87,20 @@ class RPCAPITestCase(test.TestCase): self.assertEqual(['foo', 'bar'], exmods) @mock.patch.object(rpc, 'RequestContextSerializer') - @mock.patch.object(messaging, 'RPCClient') - def test_get_client(self, mock_client, mock_ser): + @mock.patch.object(messaging, 'get_rpc_client') + def test_get_client(self, mock_get, mock_ser): rpc.TRANSPORT = mock.Mock() tgt = mock.Mock() ser = mock.Mock() - mock_client.return_value = 'client' + mock_get.return_value = 'client' mock_ser.return_value = ser client = rpc.get_client(tgt, version_cap='1.0', serializer='foo') mock_ser.assert_called_once_with('foo') - mock_client.assert_called_once_with(rpc.TRANSPORT, - tgt, version_cap='1.0', - serializer=ser) + mock_get.assert_called_once_with(rpc.TRANSPORT, + tgt, version_cap='1.0', + serializer=ser) self.assertEqual('client', client) @mock.patch.object(rpc, 'RequestContextSerializer') diff --git a/requirements.txt b/requirements.txt index 3fd47e36..f3ab31ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ microversion-parse>=0.2.1 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0 oslo.db>=4.44.0 # Apache-2.0 -oslo.messaging>=5.29.0 # Apache-2.0 +oslo.messaging>=14.1.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0