]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Eliminate extra queries used to retrieve gw_ports
authorKevin Benton <blak111@gmail.com>
Fri, 17 Apr 2015 11:54:41 +0000 (04:54 -0700)
committerKevin Benton <blak111@gmail.com>
Sat, 25 Apr 2015 17:20:01 +0000 (10:20 -0700)
commit682c0fdcc2faad07e82968a7a7739f2dedd7173f
tree3714180c1859ddaa8527e376412aa973512f524a
parent5d427e225e7127dce66905d027728fda64e3fa03
Eliminate extra queries used to retrieve gw_ports

The _get_sync_routers method was calling get_routers and
then getting the gateway ports from the db in a separate
get_ports call. This extra call is unnecessary since is
already an SQL relationship directly between the router
and it's gw_port.

This patch eliminates all of the additional gw_port retrieval
logic by replacing the get_routers call with a _get_collection
call to make use of the gw_port object already present on
each router object.

Change-Id: I478bfef8b0273b343aa72bcd6787a486eba4f006
Partial-Bug: #1445412
neutron/db/l3_db.py
neutron/tests/unit/extensions/test_l3.py