remove unused reraise_as_retryrequest
The reraise_as_retryrequest decorator is already defined in neutron_lib.db.utils and is no longer used in neutron [1]. This patch removes the dead code from neutron. [1] http://codesearch.openstack.org/?q=reraise_as_retryrequest Change-Id: Ie453dea132bc8b7f195b68c22a7ec150765102b2
This commit is contained in:
parent
fde6710515
commit
4ec751a800
|
@ -166,21 +166,6 @@ def retry_if_session_inactive(context_var_name='context'):
|
|||
return decorator
|
||||
|
||||
|
||||
def reraise_as_retryrequest(f):
|
||||
"""Packs retriable exceptions into a RetryRequest."""
|
||||
|
||||
@six.wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
try:
|
||||
return f(*args, **kwargs)
|
||||
except Exception as e:
|
||||
with excutils.save_and_reraise_exception() as ctx:
|
||||
if is_retriable(e):
|
||||
ctx.reraise = False
|
||||
raise db_exc.RetryRequest(e)
|
||||
return wrapped
|
||||
|
||||
|
||||
def _is_nested_instance(e, etypes):
|
||||
"""Check if exception or its inner excepts are an instance of etypes."""
|
||||
if isinstance(e, etypes):
|
||||
|
|
Loading…
Reference in New Issue