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. This patch also bumps the neutron-lib version up to 1.20.0 Change-Id: I670d3cef59d8e729e573323fc636a08ff7b86920
This commit is contained in:
parent
f2c2a51a9f
commit
f32927857d
|
@ -51,7 +51,7 @@ msgpack-python==0.4.0
|
|||
munch==2.1.0
|
||||
netaddr==0.7.18
|
||||
netifaces==0.10.4
|
||||
neutron-lib==1.18.0
|
||||
neutron-lib==1.20.0
|
||||
neutron==13.0.0.0b1
|
||||
openstackdocstheme==1.18.1
|
||||
openstacksdk==0.11.2
|
||||
|
|
|
@ -17,13 +17,13 @@ import copy
|
|||
|
||||
import netaddr
|
||||
|
||||
from neutron.db import _model_query as model_query
|
||||
from neutron.db import common_db_mixin
|
||||
from neutron_lib.api.definitions import constants as fw_const
|
||||
from neutron_lib import constants as nl_constants
|
||||
from neutron_lib.db import api as db_api
|
||||
from neutron_lib.db import constants as db_constants
|
||||
from neutron_lib.db import model_base
|
||||
from neutron_lib.db import model_query
|
||||
from neutron_lib import exceptions
|
||||
from neutron_lib.exceptions import firewall_v2 as f_exc
|
||||
from oslo_db import exception as db_exc
|
||||
|
@ -838,7 +838,8 @@ class FirewallPluginDb(common_db_mixin.CommonDbMixin):
|
|||
|
||||
def _get_default_fwg_id(self, context, tenant_id):
|
||||
"""Returns an id of default firewall group for given tenant or None"""
|
||||
default_fwg = self._model_query(context, FirewallGroup).filter_by(
|
||||
default_fwg = model_query.query_with_hooks(
|
||||
context, FirewallGroup).filter_by(
|
||||
project_id=tenant_id, name=const.DEFAULT_FWG).first()
|
||||
if default_fwg:
|
||||
return default_fwg.id
|
||||
|
@ -846,7 +847,8 @@ class FirewallPluginDb(common_db_mixin.CommonDbMixin):
|
|||
|
||||
def get_fwg_attached_to_port(self, context, port_id):
|
||||
"""Return a firewall group ID that is attached to a given port"""
|
||||
fwg_port = self._model_query(context, FirewallGroupPortAssociation).\
|
||||
fwg_port = model_query.query_with_hooks(
|
||||
context, FirewallGroupPortAssociation).\
|
||||
filter_by(port_id=port_id).first()
|
||||
if fwg_port:
|
||||
return fwg_port.firewall_group_id
|
||||
|
|
|
@ -8,7 +8,7 @@ netaddr>=0.7.18 # BSD
|
|||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||
alembic>=0.8.10 # MIT
|
||||
six>=1.10.0 # MIT
|
||||
neutron-lib>=1.18.0 # Apache-2.0
|
||||
neutron-lib>=1.20.0 # Apache-2.0
|
||||
oslo.config>=5.2.0 # Apache-2.0
|
||||
oslo.db>=4.27.0 # Apache-2.0
|
||||
oslo.log>=3.36.0 # Apache-2.0
|
||||
|
|
Loading…
Reference in New Issue