diff --git a/neutron/common/utils.py b/neutron/common/utils.py index 8d8654072f4..f8612287188 100644 --- a/neutron/common/utils.py +++ b/neutron/common/utils.py @@ -34,6 +34,7 @@ import eventlet from eventlet.green import subprocess import netaddr from neutron_lib import constants as n_const +from neutron_lib.db import api as db_api from neutron_lib.utils import helpers from oslo_config import cfg from oslo_db import exception as db_exc @@ -44,7 +45,6 @@ import six import neutron from neutron._i18n import _ from neutron.api import api_common -from neutron.db import api as db_api TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" LOG = logging.getLogger(__name__) @@ -552,7 +552,7 @@ def create_object_with_dependency(creator, dep_getter, dep_creator, This function protects against all of the cases where the dependency can be concurrently removed by catching exceptions and restarting the process of creating the dependency if one no longer exists. It will - give up after neutron.db.api.MAX_RETRIES and raise the exception it + give up after neutron_lib.db.api.MAX_RETRIES and raise the exception it encounters after that. """ result, dependency, dep_id, made_locally = None, None, None, False diff --git a/neutron/db/api.py b/neutron/db/api.py index 7182b591172..a93b19fe764 100644 --- a/neutron/db/api.py +++ b/neutron/db/api.py @@ -41,9 +41,6 @@ profiler_opts.set_defaults(cfg.CONF) context_manager.append_on_engine_create(set_hook) -MAX_RETRIES = 10 - - # Expire relationships when foreign key changes. # # NOTE(ihrachys) Arguably, it's a sqlalchemy anti-pattern to access child