Browse Source

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
changes/83/617383/1
Boden R 4 years ago
parent
commit
ee93968b69
  1. 3
      tricircle/network/central_fc_driver.py
  2. 3
      tricircle/network/central_sfc_driver.py

3
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:

3
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:

Loading…
Cancel
Save