remove common db alaises to db utils

A handful of the functions implemented in neutron.db._utils are exposed
in common_db_mixin as aliases. These are unneeded as they're already
defined elsewhere.

This patch removes the following aliases in common_db_mixin:
- safe_creation
- model_query_scope
- model_query
- resource_fields

It also renames the UT for common db mixin to
test__utils to reflect the fact that its testing functions
from the _utils db module.


Change-Id: I53cd533f107d950f163ad5b19b47097546a4691d
Boden R 5 years ago
parent f2dec7112e
commit d034df15a1

@ -20,13 +20,6 @@ from neutron.db import _resource_extend
from neutron.db import _utils as ndb_utils
# TODO(HenryG): Remove these when available in neutron-lib
safe_creation = ndb_utils.safe_creation
model_query_scope = ndb_utils.model_query_scope_is_project
model_query = ndb_utils.model_query
resource_fields = ndb_utils.resource_fields
# TODO(HenryG): Deprecate and schedule for removal
class CommonDbMixin(object):

@ -46,7 +46,6 @@ from neutron.db import _model_query as model_query
from neutron.db import _resource_extend as resource_extend
from neutron.db import _utils as db_utils
from neutron.db import api as db_api
from neutron.db import common_db_mixin
from neutron.db.models import l3 as l3_models
from neutron.db import models_v2
from neutron.db import standardattrdescription_db as st_attr
@ -249,9 +248,9 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
delete = functools.partial(self.delete_router, context)
update_gw = functools.partial(self._update_gw_for_create_router,
context, gw_info)
router_db, _unused = common_db_mixin.safe_creation(context, create,
delete, update_gw,
router_db, _unused = db_utils.safe_creation(context, create,
delete, update_gw,
new_router = self._make_router_dict(router_db)
registry.notify(resources.ROUTER, events.AFTER_CREATE, self,