diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-08-17 18:10:41 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-08-17 18:10:41 +0000 |
commit | 03df698990a916005211c6ef5abd95271485c00f (patch) | |
tree | 95be611c7ba38e8beb5f51f5d12d0a7eb75509c5 | |
parent | 6564190574777ca492485f5ada35e505c9b6061c (diff) | |
parent | 3aaa63986cdfe537986e74a9178a57d5783fd140 (diff) | |
download | oslo-concurrency-2.5.0.tar.gz |
Merge "Use oslo_utils reflection to get 'f' callable name"2.5.0
-rw-r--r-- | oslo_concurrency/lockutils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py index 0155dcb..fc0665e 100644 --- a/oslo_concurrency/lockutils.py +++ b/oslo_concurrency/lockutils.py @@ -26,6 +26,7 @@ import weakref import fasteners from oslo_config import cfg +from oslo_utils import reflection from oslo_utils import timeutils import six @@ -247,7 +248,8 @@ def synchronized(name, lock_file_prefix=None, external=False, lock_path=None, t2 = timeutils.now() LOG.debug('Lock "%(name)s" acquired by "%(function)s" :: ' 'waited %(wait_secs)0.3fs', - {'name': name, 'function': f.__name__, + {'name': name, + 'function': reflection.get_callable_name(f), 'wait_secs': (t2 - t1)}) return f(*args, **kwargs) finally: @@ -258,7 +260,8 @@ def synchronized(name, lock_file_prefix=None, external=False, lock_path=None, held_secs = "%0.3fs" % (t3 - t2) LOG.debug('Lock "%(name)s" released by "%(function)s" :: held ' '%(held_secs)s', - {'name': name, 'function': f.__name__, + {'name': name, + 'function': reflection.get_callable_name(f), 'held_secs': held_secs}) return inner |