From 9f41850ba36fb0715f72ba961d1b019a0e5d9665 Mon Sep 17 00:00:00 2001 From: Boden R Date: Fri, 25 Jan 2019 15:02:30 -0700 Subject: [PATCH] remove neutron.db.api references While the initial version of this patch removed neutron.db.api, a different duplicate patch [1] landed first. This patch cleans up the remining references to neutron.db.api including those in the docs and comments. [1] https://review.openstack.org/#/c/635978/ Change-Id: I5f911f4c6a1fc582a9c1006ec5e2880853ff2909 --- doc/source/contributor/internals/quality_of_service.rst | 2 +- doc/source/contributor/internals/quota.rst | 2 +- doc/source/contributor/internals/retries.rst | 2 +- neutron/db/db_base_plugin_v2.py | 2 +- neutron/hacking/checks.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/contributor/internals/quality_of_service.rst b/doc/source/contributor/internals/quality_of_service.rst index c2019baf44c..07384fe2fa5 100644 --- a/doc/source/contributor/internals/quality_of_service.rst +++ b/doc/source/contributor/internals/quality_of_service.rst @@ -218,7 +218,7 @@ instantiated (and to suggest just that, the base rule class is marked as ABC). QoS objects rely on some primitive database API functions that are added in: -* neutron.db.api: those can be reused to fetch other models that do not have +* neutron_lib.db.api: those can be reused to fetch other models that do not have corresponding versioned objects yet, if needed. * neutron.db.qos.api: contains database functions that are specific to QoS models. diff --git a/doc/source/contributor/internals/quota.rst b/doc/source/contributor/internals/quota.rst index b4e5d72fe32..4b8fa90179f 100644 --- a/doc/source/contributor/internals/quota.rst +++ b/doc/source/contributor/internals/quota.rst @@ -222,7 +222,7 @@ In order to ensure correct operations, a row-level lock is acquired in the transaction which creates the reservation. The lock is acquired when reading usage data. In case of write-set certification failures, which can occur in active/active clusters such as MySQL galera, the decorator -neutron.db.api.retry_db_errors will retry the transaction if a DBDeadLock +neutron_lib.db.api.retry_db_errors will retry the transaction if a DBDeadLock exception is raised. While non-locking approaches are possible, it has been found out that, since a non-locking algorithms increases the chances of collision, the cost of diff --git a/doc/source/contributor/internals/retries.rst b/doc/source/contributor/internals/retries.rst index d0311b91b13..64342a33ad0 100644 --- a/doc/source/contributor/internals/retries.rst +++ b/doc/source/contributor/internals/retries.rst @@ -24,7 +24,7 @@ Retrying Operations =================== -Inside of the neutron.db.api module there is a decorator called +Inside of the neutron_lib.db.api module there is a decorator called 'retry_if_session_inactive'. This should be used to protect any functions that perform DB operations. This decorator will capture any deadlock errors, RetryRequests, connection errors, and unique diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py index befc1664ffc..27eac17bf9b 100644 --- a/neutron/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -434,7 +434,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon, action='access_as_shared', target_tenant='*') # TODO(ihrachys) Below can be removed when we make sqlalchemy - # event listeners in neutron/db/api.py to refresh expired + # event listeners in neutron_lib/db/api.py to refresh expired # attributes. # # First trigger expiration of rbac_entries. diff --git a/neutron/hacking/checks.py b/neutron/hacking/checks.py index 62effbd9593..79c5177d413 100644 --- a/neutron/hacking/checks.py +++ b/neutron/hacking/checks.py @@ -246,7 +246,7 @@ def check_python3_no_filter(logical_line): # TODO(boden): rehome this check to neutron-lib @flake8ext def check_no_sqlalchemy_event_import(logical_line, filename, noqa): - """N346 - Use neutron.db.api.sqla_listen instead of sqlalchemy event.""" + """N346 - Use neutron_lib.db.api.sqla_listen rather than sqlalchemy.""" if noqa: return is_import = (logical_line.startswith('import') or