]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Sync openstack.common.local from oslo
authorIlya Pekelny <ipekelny@mirantis.com>
Fri, 22 Nov 2013 12:04:26 +0000 (14:04 +0200)
committerIlya Pekelny <ipekelny@mirantis.com>
Fri, 22 Nov 2013 14:57:03 +0000 (16:57 +0200)
`local` has a broken TLS symbol - strong_store, fixed in oslo some time ago in
Ib544be1485823f6c619312fdee5a04031f48bbb4. All direct and indirect
(lockutils and rpc) usages of strong_store might be potentially affected.
Original change to Nova: If4dd973acc23921dbc2bc69bb76225deb2802dad

Closes-Bug: #1254046
Change-Id: I6e5efa156c9a905a979a469244cd483723e6b1e3

neutron/openstack/common/local.py

index f1bfc824bf6103c18f357c0dbcf57da9a76e4551..e82f17d0f3fd307724a7f1b3ffb0454cd449219e 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-"""Greenthread local storage of variables using weak references"""
+"""Local storage of variables using weak references"""
 
+import threading
 import weakref
 
-from eventlet import corolocal
 
-
-class WeakLocal(corolocal.local):
+class WeakLocal(threading.local):
     def __getattribute__(self, attr):
-        rval = corolocal.local.__getattribute__(self, attr)
+        rval = super(WeakLocal, self).__getattribute__(attr)
         if rval:
             # NOTE(mikal): this bit is confusing. What is stored is a weak
             # reference, not the value itself. We therefore need to lookup
@@ -34,7 +33,7 @@ class WeakLocal(corolocal.local):
 
     def __setattr__(self, attr, value):
         value = weakref.ref(value)
-        return corolocal.local.__setattr__(self, attr, value)
+        return super(WeakLocal, self).__setattr__(attr, value)
 
 
 # NOTE(mikal): the name "store" should be deprecated in the future
@@ -45,4 +44,4 @@ store = WeakLocal()
 # "strong" store will hold a reference to the object so that it never falls out
 # of scope.
 weak_store = WeakLocal()
-strong_store = corolocal.local
+strong_store = threading.local()