]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Create dvr base class and stop passing around snat_ports
authorCarl Baldwin <carl.baldwin@hp.com>
Thu, 9 Jul 2015 22:05:05 +0000 (22:05 +0000)
committerCarl Baldwin <carl@ecbaldwin.net>
Wed, 15 Jul 2015 18:36:40 +0000 (18:36 +0000)
commit701b119d9ce880940b85f9143e97e05c1c2378a0
tree28d794d6000d756d2d3745ce25271784490a2f42
parentc4ad2ce03c8cdc4546b664798a696ebdf1bc6d91
Create dvr base class and stop passing around snat_ports

The one thing that I see that the two dvr classes have in common is
the ability to map internal ports to snat ports.  The dvr local router
needs it to set up a redirect to the central part.  The central part
needs it to create the port for the internal network.

This change renames the mapping method to something more logical and
removes snat_ports as an argument to two methods because it is a quick
O(1) operation to get it from the router dict and passing it around
just tangles things up.

Change-Id: Icc099c1a97e3e68eeaf4690bc83167ba30d8099a
neutron/agent/l3/dvr_edge_router.py
neutron/agent/l3/dvr_local_router.py
neutron/agent/l3/dvr_router_base.py [new file with mode: 0644]
neutron/tests/unit/agent/l3/test_agent.py