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
This commit is contained in:
Boden R 2019-01-25 15:02:30 -07:00
parent 0755c97a2d
commit 9f41850ba3
5 changed files with 5 additions and 5 deletions

View File

@ -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: 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. corresponding versioned objects yet, if needed.
* neutron.db.qos.api: contains database functions that are specific to QoS * neutron.db.qos.api: contains database functions that are specific to QoS
models. models.

View File

@ -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 the transaction which creates the reservation. The lock is acquired when
reading usage data. In case of write-set certification failures, reading usage data. In case of write-set certification failures,
which can occur in active/active clusters such as MySQL galera, the decorator 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. exception is raised.
While non-locking approaches are possible, it has been found out that, since 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 a non-locking algorithms increases the chances of collision, the cost of

View File

@ -24,7 +24,7 @@
Retrying Operations 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 'retry_if_session_inactive'. This should be used to protect any
functions that perform DB operations. This decorator will capture functions that perform DB operations. This decorator will capture
any deadlock errors, RetryRequests, connection errors, and unique any deadlock errors, RetryRequests, connection errors, and unique

View File

@ -434,7 +434,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
action='access_as_shared', target_tenant='*') action='access_as_shared', target_tenant='*')
# TODO(ihrachys) Below can be removed when we make sqlalchemy # 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. # attributes.
# #
# First trigger expiration of rbac_entries. # First trigger expiration of rbac_entries.

View File

@ -246,7 +246,7 @@ def check_python3_no_filter(logical_line):
# TODO(boden): rehome this check to neutron-lib # TODO(boden): rehome this check to neutron-lib
@flake8ext @flake8ext
def check_no_sqlalchemy_event_import(logical_line, filename, noqa): 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: if noqa:
return return
is_import = (logical_line.startswith('import') or is_import = (logical_line.startswith('import') or