Use log.warning() instead of log.warn()
warn() is provided by ContextAdapter, there's no reason to use it.
This commit is contained in:
parent
daae091c7c
commit
fd68391d53
@ -113,10 +113,11 @@ class _CallContext(object):
|
|||||||
locks_held = self.check_for_lock(self.conf)
|
locks_held = self.check_for_lock(self.conf)
|
||||||
if locks_held:
|
if locks_held:
|
||||||
stack = ' :: '.join([frame[3] for frame in inspect.stack()])
|
stack = ' :: '.join([frame[3] for frame in inspect.stack()])
|
||||||
_LOG.warn('An RPC is being made while holding a lock. The locks '
|
_LOG.warning('An RPC is being made while holding a lock. The '
|
||||||
'currently held are %(locks)s. This is probably a bug. '
|
'locks currently held are %(locks)s. This is '
|
||||||
'Please report it. Include the following: [%(stack)s].',
|
'probably a bug. Please report it. Include the '
|
||||||
{'locks': locks_held, 'stack': stack})
|
'following: [%(stack)s].',
|
||||||
|
{'locks': locks_held, 'stack': stack})
|
||||||
|
|
||||||
def call(self, ctxt, method, **kwargs):
|
def call(self, ctxt, method, **kwargs):
|
||||||
"""Invoke a method and wait for a reply. See RPCClient.call()."""
|
"""Invoke a method and wait for a reply. See RPCClient.call()."""
|
||||||
|
@ -523,7 +523,7 @@ class TestCheckForLock(test_utils.BaseTestCase):
|
|||||||
a = a[0]
|
a = a[0]
|
||||||
warnings.append(msg % a)
|
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')
|
client.call({}, 'foo')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user