Merge "Use SQL IN clause instead of OR with exact match comparisons"
This commit is contained in:
commit
db93cc5555
@ -13,7 +13,6 @@
|
|||||||
from neutron_lib.db import api as db_api
|
from neutron_lib.db import api as db_api
|
||||||
from neutron_lib.objects import common_types
|
from neutron_lib.objects import common_types
|
||||||
from oslo_versionedobjects import fields as obj_fields
|
from oslo_versionedobjects import fields as obj_fields
|
||||||
import sqlalchemy as sa
|
|
||||||
from sqlalchemy.orm import joinedload
|
from sqlalchemy.orm import joinedload
|
||||||
|
|
||||||
from sqlalchemy import sql
|
from sqlalchemy import sql
|
||||||
@ -61,9 +60,8 @@ class RouterL3AgentBinding(base.NeutronDbObject):
|
|||||||
l3_attrs.RouterExtraAttributes,
|
l3_attrs.RouterExtraAttributes,
|
||||||
l3_attrs.RouterExtraAttributes.router_id ==
|
l3_attrs.RouterExtraAttributes.router_id ==
|
||||||
l3agent.RouterL3AgentBinding.router_id).filter(
|
l3agent.RouterL3AgentBinding.router_id).filter(
|
||||||
sa.or_(
|
l3_attrs.RouterExtraAttributes.ha.in_([sql.false(),
|
||||||
l3_attrs.RouterExtraAttributes.ha == sql.false(),
|
sql.null()])))
|
||||||
l3_attrs.RouterExtraAttributes.ha == sql.null())))
|
|
||||||
bindings = [cls._load_object(context, db_obj) for db_obj in
|
bindings = [cls._load_object(context, db_obj) for db_obj in
|
||||||
query.all()]
|
query.all()]
|
||||||
return bindings
|
return bindings
|
||||||
|
Loading…
Reference in New Issue
Block a user