Use log.warning() instead of log.warn()

warn() is provided by ContextAdapter, there's no reason to use it.
This commit is contained in:
Mark McLoughlin 2013-06-16 12:00:09 +01:00
parent daae091c7c
commit fd68391d53
2 changed files with 6 additions and 5 deletions

View File

@ -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()."""

View File

@ -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')