From c04b8ddd907d786c0ea2fccd31b82561f2cdb8fc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 8 Mar 2019 14:09:14 -0500 Subject: [PATCH] Join on explcit relationship paths The join() in get_router_for_floatingip() is joining from entity to entity without an explicit ON clause which creates an ambiguous situation. SQLAlchemy 1.3 guards against this now, so use the real relationship-bound path so that the ORM does not need to guess. Closes-bug: #1819260 Change-Id: Ia377a9d1a32a78abdaee74c79e395acd77e486ef --- neutron/db/l3_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/l3_db.py b/neutron/db/l3_db.py index b15162d6895..165ad9df588 100644 --- a/neutron/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -1160,7 +1160,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase, # TODO(lujinluo): Need IPAllocation and Port object routerport_qry = context.session.query( RouterPort.router_id, models_v2.IPAllocation.ip_address).join( - models_v2.Port, models_v2.IPAllocation).filter( + RouterPort.port, models_v2.Port.fixed_ips).filter( models_v2.Port.network_id == internal_port['network_id'], RouterPort.port_type.in_(constants.ROUTER_INTERFACE_OWNERS), models_v2.IPAllocation.subnet_id == internal_subnet['id']