Fix outerjoin to comply with SQLAlchemy 1.3 strictness

The outerjoin in neutron_dynamic_routing/db/bgp_db.py does not meet
with the stricter new standards in SQLAlchemy 1.3, so this finds a
more compliant form.

[1] https://docs.sqlalchemy.org/en/13/changelog/migration_13.html#query-join-handles-ambiguity-in-deciding-the-left-side-more-explicitly

Change-Id: I603a2febb1755b6db17e6ac9cb22015a1f3336d4
Closes-Bug: #1898634
This commit is contained in:
Nate Johnston 2020-10-07 21:56:49 -04:00 committed by Jens Harbott (frickler)
parent 3d5e1c9035
commit 4212b70538

View File

@ -670,7 +670,7 @@ class BgpDbMixin(object):
next_hop_alias.subnet_id == models_v2.Subnet.id,
models_v2.Subnet.ip_version == 4)
query = query.outerjoin(router_attrs,
l3_db.Router.id == router_attrs.router_id)
router_attrs.router_id == l3_db.Router.id)
query = query.filter(router_attrs.distributed != sa.sql.true())
return self._host_route_list_from_tuples(query.all())