Merge "Remove context.spawn"
This commit is contained in:
commit
1281036a81
@ -13,7 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import eventlet
|
||||
from keystoneclient.v3 import client as keystone_client
|
||||
import logging
|
||||
from oslo_config import cfg
|
||||
@ -108,26 +107,6 @@ def set_ctx(new_ctx):
|
||||
utils.set_thread_local(_CTX_THREAD_LOCAL_NAME, new_ctx)
|
||||
|
||||
|
||||
def _wrapper(context, thread_desc, thread_group, func, *args, **kwargs):
|
||||
try:
|
||||
set_ctx(context)
|
||||
func(*args, **kwargs)
|
||||
except Exception as e:
|
||||
if thread_group and not thread_group.exc:
|
||||
thread_group.exc = e
|
||||
thread_group.failed_thread = thread_desc
|
||||
finally:
|
||||
if thread_group:
|
||||
thread_group._on_thread_exit()
|
||||
|
||||
set_ctx(None)
|
||||
|
||||
|
||||
def spawn(thread_description, func, *args, **kwargs):
|
||||
eventlet.spawn(_wrapper, ctx().clone(), thread_description,
|
||||
None, func, *args, **kwargs)
|
||||
|
||||
|
||||
def context_from_headers_and_env(headers, env):
|
||||
params = _extract_auth_params_from_headers(headers)
|
||||
auth_cacert = params['auth_cacert']
|
||||
|
Loading…
x
Reference in New Issue
Block a user