File: Fix_outerjoin_to_comply_with_SQLAlchemy_1.3_strictness.patch

package info (click to toggle)
neutron-dynamic-routing 2%3A27.0.0~rc1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,216 kB
  • sloc: python: 6,592; sh: 152; makefile: 45
file content (26 lines) | stat: -rw-r--r-- 1,433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Subject: [PATCH] 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
Author: Nate Johnston <nate.johnston@redhat.com>
Date: Wed, 7 Oct 2020 21:56:49 -0400
Change-Id: I603a2febb1755b6db17e6ac9cb22015a1f3336d4
Closes-Bug: #1898634
Origin: https://review.opendev.org/c/openstack/neutron-dynamic-routing/+/756613
Last-Update: 2020-12-08

Index: neutron-dynamic-routing/neutron_dynamic_routing/db/bgp_db.py
===================================================================
--- neutron-dynamic-routing.orig/neutron_dynamic_routing/db/bgp_db.py
+++ neutron-dynamic-routing/neutron_dynamic_routing/db/bgp_db.py
@@ -613,7 +613,7 @@ class BgpDbMixin:
                 BgpSpeaker.id == bgp_speaker_id,
                 BgpSpeaker.advertise_floating_ip_host_routes == sa.sql.true())
             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())