Remove use of Oslo Incubator local
Remove last use of Oslo Incubator and cleanup docs. Change-Id: I56c8dbbc72733446f970a7f6a4a651d11422de8e
This commit is contained in:
parent
5ad7b36e45
commit
e9ce471c27
14
HACKING.rst
14
HACKING.rst
|
@ -254,20 +254,6 @@ without the patch and passes with the patch.
|
|||
|
||||
NOTE: 100% coverage is required
|
||||
|
||||
openstack-common
|
||||
----------------
|
||||
|
||||
A number of modules from openstack-common are imported into the project.
|
||||
|
||||
These modules are "incubating" in openstack-common and are kept in sync
|
||||
with the help of openstack-common's update.py script. See:
|
||||
|
||||
http://wiki.openstack.org/CommonLibrary#Incubation
|
||||
|
||||
The copy of the code should never be directly modified here. Please
|
||||
always update openstack-common first and then run the script to copy
|
||||
the changes across.
|
||||
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[DEFAULT]
|
||||
base=poppy
|
||||
module=local
|
|
@ -1,17 +0,0 @@
|
|||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
|
||||
|
||||
six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox'))
|
|
@ -1,45 +0,0 @@
|
|||
# Copyright 2011 OpenStack Foundation.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Local storage of variables using weak references"""
|
||||
|
||||
import threading
|
||||
import weakref
|
||||
|
||||
|
||||
class WeakLocal(threading.local):
|
||||
def __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
|
||||
# the weak reference and return the inner value here.
|
||||
rval = rval()
|
||||
return rval
|
||||
|
||||
def __setattr__(self, attr, value):
|
||||
value = weakref.ref(value)
|
||||
return super(WeakLocal, self).__setattr__(attr, value)
|
||||
|
||||
|
||||
# NOTE(mikal): the name "store" should be deprecated in the future
|
||||
store = WeakLocal()
|
||||
|
||||
# A "weak" store uses weak references and allows an object to fall out of scope
|
||||
# when it falls out of scope in the code that uses the thread local storage. A
|
||||
# "strong" store will hold a reference to the object so that it never falls out
|
||||
# of scope.
|
||||
weak_store = WeakLocal()
|
||||
strong_store = threading.local()
|
|
@ -17,8 +17,9 @@ from oslo_config import cfg
|
|||
from oslo_context import context
|
||||
import pecan
|
||||
from pecan import hooks
|
||||
import threading
|
||||
|
||||
from poppy.openstack.common import local
|
||||
_local_store = threading.local()
|
||||
|
||||
|
||||
class PoppyRequestContext(context.RequestContext):
|
||||
|
@ -56,13 +57,13 @@ class ContextHook(hooks.PecanHook):
|
|||
|
||||
request_context = PoppyRequestContext(**context_kwargs)
|
||||
state.request.context = request_context
|
||||
local.store.context = request_context
|
||||
_local_store.context = request_context
|
||||
|
||||
'''Attach tenant_id as a member variable project_id to controller.'''
|
||||
state.controller.__self__.project_id = getattr(local.store.context,
|
||||
state.controller.__self__.project_id = getattr(_local_store.context,
|
||||
"tenant", None)
|
||||
state.controller.__self__.base_url = getattr(local.store.context,
|
||||
state.controller.__self__.base_url = getattr(_local_store.context,
|
||||
"base_url", None)
|
||||
'''Attach auth_token as a member variable project_id to controller.'''
|
||||
state.controller.__self__.auth_token = getattr(local.store.context,
|
||||
state.controller.__self__.auth_token = getattr(_local_store.context,
|
||||
"auth_token", None)
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -56,7 +56,7 @@ commands = {posargs}
|
|||
|
||||
[flake8]
|
||||
builtins = __CDN_SETUP__
|
||||
exclude = build,.venv*,venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv
|
||||
exclude = build,.venv*,venv*,.git,.tox,dist,doc,*lib/python*,*.egg,.update-venv
|
||||
|
||||
[hacking]
|
||||
import_exceptions = poppy.common._i18n._
|
||||
|
|
Loading…
Reference in New Issue