From fd68391d53d81beb62d9b3f91cc7fe82a37748de Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Sun, 16 Jun 2013 12:00:09 +0100 Subject: [PATCH] Use log.warning() instead of log.warn() warn() is provided by ContextAdapter, there's no reason to use it. --- oslo/messaging/rpc/client.py | 9 +++++---- tests/test_rpc_client.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) 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')