delete common_db_mixin
The functionality within neutron.db.common_db_mixin is available via neutron-lib APIs. This patch removes common_db_mixin and updates any uses of it to use neutron-lib instead. Depends-On: https://review.openstack.org/#/c/636159/ NeutronLibImpact Change-Id: I2388f90b37abb09408809dda8c21da551bcd94bbchanges/64/635664/2
parent
e9e76ce4b7
commit
957eca96f4
@ -1,62 +0,0 @@
|
||||
# Copyright (c) 2014 OpenStack Foundation.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.db import model_query
|
||||
from neutron_lib.db import utils as db_utils
|
||||
|
||||
|
||||
# TODO(HenryG): Deprecate and schedule for removal
|
||||
class CommonDbMixin(object):
|
||||
"""Deprecated."""
|
||||
|
||||
@staticmethod
|
||||
def _model_query(context, model):
|
||||
return model_query.query_with_hooks(context, model)
|
||||
|
||||
@staticmethod
|
||||
def _fields(resource, fields):
|
||||
return db_utils.resource_fields(resource, fields)
|
||||
|
||||
@staticmethod
|
||||
def _get_by_id(context, model, id):
|
||||
return model_query.get_by_id(context, model, id)
|
||||
|
||||
@staticmethod
|
||||
def _get_collection_query(context, model,
|
||||
filters=None, sorts=None,
|
||||
limit=None, marker_obj=None,
|
||||
page_reverse=False):
|
||||
return model_query.get_collection_query(context, model,
|
||||
filters, sorts,
|
||||
limit, marker_obj,
|
||||
page_reverse)
|
||||
|
||||
@staticmethod
|
||||
def _get_collection(context, model, dict_func,
|
||||
filters=None, fields=None, sorts=None,
|
||||
limit=None, marker_obj=None,
|
||||
page_reverse=False):
|
||||
return model_query.get_collection(context, model, dict_func,
|
||||
filters, fields, sorts,
|
||||
limit, marker_obj,
|
||||
page_reverse)
|
||||
|
||||
@staticmethod
|
||||
def _get_collection_count(context, model, filters=None):
|
||||
return model_query.get_collection_count(context, model, filters)
|
||||
|
||||
# TODO(HenryG): Remove this when available in neutron-lib
|
||||
def _get_marker_obj(self, context, resource, limit, marker):
|
||||
return db_utils.get_marker_obj(self, context, resource, limit, marker)
|
Loading…
Reference in New Issue