From a39bc9758cc713d46092101475ac4edd404f93f5 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 3 Apr 2019 18:48:32 +0100 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. This mock replicates the original query without the "gw_port.device_owner == DEVICE_OWNER_ROUTER_GW" filter. Error [1] found in [2]. Based on [3]. [1] http://paste.openstack.org/show/748825 [2] https://review.openstack.org/#/c/649508 [3] https://review.openstack.org/#/c/642117 Change-Id: I7e12e2a2b6f9e8eb2233819f41d1065c95f0d552 Closes-Bug: #1823059 --- neutron/tests/unit/extensions/test_l3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/tests/unit/extensions/test_l3.py b/neutron/tests/unit/extensions/test_l3.py index 2cb6fb06d18..18ab5a6e8a6 100644 --- a/neutron/tests/unit/extensions/test_l3.py +++ b/neutron/tests/unit/extensions/test_l3.py @@ -3144,7 +3144,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin): l3_models.RouterPort.router_id, models_v2.IPAllocation.ip_address ).join( - models_v2.Port, models_v2.IPAllocation + l3_models.RouterPort.port, models_v2.Port.fixed_ips ).filter( models_v2.Port.network_id == internal_port['network_id'], l3_models.RouterPort.port_type.in_(