diff --git a/oslo/messaging/rpc/client.py b/oslo/messaging/rpc/client.py index d78bb940b..06c8d71fd 100644 --- a/oslo/messaging/rpc/client.py +++ b/oslo/messaging/rpc/client.py @@ -113,10 +113,11 @@ class _CallContext(object): locks_held = self.check_for_lock(self.conf) if locks_held: stack = ' :: '.join([frame[3] for frame in inspect.stack()]) - _LOG.warn('An RPC is being made while holding a lock. The locks ' - 'currently held are %(locks)s. This is probably a bug. ' - 'Please report it. Include the following: [%(stack)s].', - {'locks': locks_held, 'stack': stack}) + _LOG.warning('An RPC is being made while holding a lock. The ' + 'locks currently held are %(locks)s. This is ' + 'probably a bug. Please report it. Include the ' + 'following: [%(stack)s].', + {'locks': locks_held, 'stack': stack}) def call(self, ctxt, method, **kwargs): """Invoke a method and wait for a reply. See RPCClient.call().""" diff --git a/tests/test_rpc_client.py b/tests/test_rpc_client.py index 3641763e2..fcf8bb140 100644 --- a/tests/test_rpc_client.py +++ b/tests/test_rpc_client.py @@ -523,7 +523,7 @@ class TestCheckForLock(test_utils.BaseTestCase): a = a[0] warnings.append(msg % a) - self.stubs.Set(rpc_client._LOG, 'warn', stub_warn) + self.stubs.Set(rpc_client._LOG, 'warning', stub_warn) client.call({}, 'foo')