Requirements update for 9.0.0~b2
[openstack-build/neutron-build.git] / xenial / debian / patches / fix-no-attribute-code.patch
1 --- neutron.orig/neutron/db/api.py      2016-08-18 17:21:13.507395437 +0200
2 +++ neutron/neutron/db/api.py   2016-08-18 17:22:04.214899405 +0200
3 @@ -21,13 +21,11 @@
4  from oslo_db import api as oslo_db_api
5  from oslo_db import exception as db_exc
6  from oslo_db.sqlalchemy import enginefacade
7 -from oslo_log import log as logging
8  from oslo_utils import excutils
9  import osprofiler.sqlalchemy
10  import six
11  import sqlalchemy
12  from sqlalchemy.orm import exc
13 -import traceback
14  
15  from neutron.common import exceptions
16  from neutron.common import profiler  # noqa
17 @@ -45,7 +43,6 @@
18  
19  
20  MAX_RETRIES = 10
21 -LOG = logging.getLogger(__name__)
22  
23  
24  def is_retriable(e):
25 @@ -59,7 +56,7 @@
26  is_deadlock = moves.moved_function(is_retriable, 'is_deadlock', __name__,
27                                     message='use "is_retriable" instead',
28                                     version='newton', removal_version='ocata')
29 -_retry_db_errors = oslo_db_api.wrap_db_retry(
30 +retry_db_errors = oslo_db_api.wrap_db_retry(
31      max_retries=MAX_RETRIES,
32      retry_interval=0.1,
33      inc_retry_interval=True,
34 @@ -67,22 +64,6 @@
35  )
36  
37  
38 -def retry_db_errors(f):
39 -    """Log retriable exceptions before retry to help debugging."""
40 -
41 -    @_retry_db_errors
42 -    @six.wraps(f)
43 -    def wrapped(*args, **kwargs):
44 -        try:
45 -            return f(*args, **kwargs)
46 -        except Exception as e:
47 -            with excutils.save_and_reraise_exception():
48 -                if is_retriable(e):
49 -                    LOG.debug("Retry wrapper got retriable exception: %s",
50 -                              traceback.format_exc())
51 -    return wrapped
52 -
53 -
54  def reraise_as_retryrequest(f):
55      """Packs retriable exceptions into a RetryRequest."""
56