diff options
| author | Tovin Seven <vinhnt@vn.fujitsu.com> | 2018-01-18 15:22:07 +0700 |
|---|---|---|
| committer | Tovin Seven <vinhnt@vn.fujitsu.com> | 2018-01-18 15:22:07 +0700 |
| commit | 79e4e2de42e61556f6da251f351e56cadb07fe6d (patch) | |
| tree | 280bd84b2e4561992decc03920a788bdc3dd4f18 /osprofiler | |
| parent | 6647bf2ae3293832603c10b5b4ed0c255ff688fe (diff) | |
| download | osprofiler-79e4e2de42e61556f6da251f351e56cadb07fe6d.tar.gz | |
Check profiler instance before initialize
Add a small check for this to an prevent issue in Nova [1]
that causes some commands not working.
[1] http://paste.openstack.org/show/641262/
Change-Id: I685386695e13bf5034a1008dbdcff4539eb482d2
Closes-Bug: #1743586
Diffstat (limited to 'osprofiler')
| -rw-r--r-- | osprofiler/profiler.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/osprofiler/profiler.py b/osprofiler/profiler.py index 001f62a..7b46b65 100644 --- a/osprofiler/profiler.py +++ b/osprofiler/profiler.py @@ -55,8 +55,9 @@ def init(hmac_key, base_id=None, parent_id=None): :param parent_id: Used to build tree of traces. :returns: Profiler instance """ - __local_ctx.profiler = _Profiler(hmac_key, base_id=base_id, - parent_id=parent_id) + if get() is None: + __local_ctx.profiler = _Profiler(hmac_key, base_id=base_id, + parent_id=parent_id) return __local_ctx.profiler |
