use neutron-lib for _model_query

The model_query module is in neutron-lib and the CommonDBMixin will
eventually be removed. This patch swiches use of the _model_query
method over to query_with_hooks from neutron-lib.

Change-Id: Ifb99db6a13a9e3ad89eb5e790d89bb4451510bee
This commit is contained in:
Boden R 2018-11-12 14:17:15 -07:00
parent 31e510ffc8
commit ee93968b69
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ from oslo_log import log
from networking_sfc.db import sfc_db
from networking_sfc.services.flowclassifier.drivers import base as fc_driver
from neutron_lib.db import model_query
from neutron_lib.plugins import directory
from neutronclient.common import exceptions as client_exceptions
@ -85,7 +86,7 @@ class TricircleFcDriver(fc_driver.FlowClassifierDriverBase):
def _get_chain_id_by_flowclassifier_id(
self, context, fc_plugin, flowclassifier_id):
chain_classifier_assoc = fc_plugin._model_query(
chain_classifier_assoc = model_query.query_with_hooks(
context, sfc_db.ChainClassifierAssoc).filter_by(
flowclassifier_id=flowclassifier_id).first()
if chain_classifier_assoc:

View File

@ -20,6 +20,7 @@ from networking_sfc.services.sfc.drivers import base as sfc_driver
from oslo_log import log
from neutron_lib.db import model_query
from neutron_lib.plugins import directory
from neutronclient.common import exceptions as client_exceptions
@ -182,7 +183,7 @@ class TricircleSfcDriver(sfc_driver.SfcDriverBase):
net_id, t_constants.POD_NOT_SPECIFIED)
def _get_chain_id_by_group_id(self, context, sfc_plugin, portpairgroup_id):
chain_group_assoc = sfc_plugin._model_query(
chain_group_assoc = model_query.query_with_hooks(
context, sfc_db.ChainGroupAssoc).filter_by(
portpairgroup_id=portpairgroup_id).first()
if chain_group_assoc: