From ddb130736a04ff13ade9b5dee9f883203bbb59be Mon Sep 17 00:00:00 2001 From: Boden R Date: Wed, 14 Nov 2018 15:00:01 -0700 Subject: [PATCH] stop using _apply_filters_to_query The common_db_mixin will module eventually be removed from neutron as its functionality is available via neutron-lib. This patch switches uses of _apply_filters_to_query() over to apply_filters() from neutron-lib's model_query module. Change-Id: Ia8f69dcb0896f6383bae87164f8b165fb98772d1 --- vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py index cefc24d438..eaa54ae7af 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py @@ -21,6 +21,7 @@ from neutron.db import models_v2 from neutron_lib.api import validators from neutron_lib import constants from neutron_lib.db import api as db_api +from neutron_lib.db import model_query from neutron_lib import exceptions as n_exc from oslo_log import log as logging @@ -547,7 +548,7 @@ class RouterSharedDriver(router_driver.RouterBaseDriver): gw_ports_filter = {'network_id': conflict_ext_net_ids, 'device_owner': [l3_db.DEVICE_OWNER_ROUTER_GW]} ports_qry = context.session.query(models_v2.Port) - gw_ports = self.plugin._apply_filters_to_query( + gw_ports = model_query.apply_filters( ports_qry, models_v2.Port, gw_ports_filter).all() return list(set([gw_port['device_id'] for gw_port in gw_ports]))