From ee93968b69a505abbf80f05d661c817d4447d2ed Mon Sep 17 00:00:00 2001 From: Boden R Date: Mon, 12 Nov 2018 14:17:15 -0700 Subject: [PATCH] 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 --- tricircle/network/central_fc_driver.py | 3 ++- tricircle/network/central_sfc_driver.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tricircle/network/central_fc_driver.py b/tricircle/network/central_fc_driver.py index 5b1030ef..b3e15098 100644 --- a/tricircle/network/central_fc_driver.py +++ b/tricircle/network/central_fc_driver.py @@ -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: diff --git a/tricircle/network/central_sfc_driver.py b/tricircle/network/central_sfc_driver.py index 9b829ccc..133eaec4 100644 --- a/tricircle/network/central_sfc_driver.py +++ b/tricircle/network/central_sfc_driver.py @@ -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: