Merge "use neutron-lib for _model_query"

This commit is contained in:
Zuul 2018-12-05 20:32:26 +00:00 committed by Gerrit Code Review
commit c0b35976a9
3 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,7 @@ msgpack-python==0.4.0
munch==2.1.0 munch==2.1.0
netaddr==0.7.18 netaddr==0.7.18
netifaces==0.10.4 netifaces==0.10.4
neutron-lib==1.18.0 neutron-lib==1.20.0
neutron==12.0.0 neutron==12.0.0
openstackdocstheme==1.18.1 openstackdocstheme==1.18.1
openstacksdk==0.11.2 openstacksdk==0.11.2

View File

@ -23,6 +23,7 @@ from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib.db import api as db_api 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 neutron_lib import exceptions as n_exc
from neutron_lib.plugins import constants as pg_const from neutron_lib.plugins import constants as pg_const
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -68,7 +69,7 @@ class LoadBalancerPluginDbv2(base_db.CommonDbMixin,
# To lock the instance for update, return a single # To lock the instance for update, return a single
# instance, instead of an instance with LEFT OUTER # instance, instead of an instance with LEFT OUTER
# JOINs that do not work in PostgreSQL # JOINs that do not work in PostgreSQL
query = self._model_query(context, model).options( query = model_query.query_with_hooks(context, model).options(
lazyload('*') lazyload('*')
).filter( ).filter(
model.id == id).with_lockmode('update') model.id == id).with_lockmode('update')
@ -252,7 +253,7 @@ class LoadBalancerPluginDbv2(base_db.CommonDbMixin,
with context.session.begin(subtransactions=True): with context.session.begin(subtransactions=True):
if issubclass(model, models.LoadBalancer): if issubclass(model, models.LoadBalancer):
try: try:
model_db = (self._model_query(context, model). model_db = (model_query.query_with_hooks(context, model).
filter(model.id == id). filter(model.id == id).
options(orm.noload('vip_port')). options(orm.noload('vip_port')).
one()) one())

View File

@ -6,7 +6,7 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
requests>=2.14.2 # Apache-2.0 requests>=2.14.2 # Apache-2.0
netaddr>=0.7.18 # BSD netaddr>=0.7.18 # BSD
neutron-lib>=1.18.0 # Apache-2.0 neutron-lib>=1.20.0 # Apache-2.0
neutron>=12.0.0 # Apache-2.0 neutron>=12.0.0 # Apache-2.0
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
alembic>=0.8.10 # MIT alembic>=0.8.10 # MIT