]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix update_port_postcommit and port not found with DVR
authorSwaminathan Vasudevan <swaminathan.vasudevan@hp.com>
Mon, 29 Jun 2015 23:19:49 +0000 (16:19 -0700)
committerSwaminathan Vasudevan <swaminathan.vasudevan@hp.com>
Tue, 14 Jul 2015 19:02:10 +0000 (12:02 -0700)
commit9eed4167b63f0c0ad6c7ceeedc644e511c8dac75
tree636e4ffd8613c260693f0ceef7e7b505fb4812bc
parentd4c5e961ad3f88ee2be3d43ff516ef2f8b8dea9f
Fix update_port_postcommit and port not found with DVR

Updating DVR Router interface ports was throwing
errors in the l2pop mechanism drivers function
update_port_postcommit.

PortContext's portbinding information does not show
the status of the ports. For DVR Router interface
ports the DVRPortbinding table contains the status
information for the ports.

In the case of the update_port method, there was
no code related to DVR that retreives the port
binding information from the DVRPortBinding table.

This was working before, since in the driver_context,
the PortContext was just returning the port status for
all router interfaces.

With the recent refactor to the driver_context, this
behavior changed and the PortContext was returning the
_binding.status for the DVR router interface ports and
the _port.status for the non DVR ports.

When the update_port function calls update_port_postcommit
with PortContext for DVR router interface ports, l2pop
was throwing an error saying that Portbinding does not
have the attribute 'status'.

This was causing addition of any second subnet to the
same network with respect to IPv6 to fail.
Because in the case of IPv6, when you add additional
subnets to the existing network, it just updates the port
with the IPv6 prefix instead of creating additional port.

In the case of IPv4 still we could see that there are
two different ports created for each subnet we try to
add.

This patch fixes the above issue in l2pop and allows the
DVR router interface ports to be successfull.

Also the _find_ipv6_router_port_by_network was returning
all the ports for DVR including the DVR CSNAT internal
ports which are not part of the router interface ports.

This patch also fixes this problem by returning false,
when it finds a DVR SNAT port.

Closes-Bug: #1465434

Change-Id: Id243a4b3f30071226411ace6d12550fc099901cc
neutron/db/l3_dvr_db.py
neutron/plugins/ml2/plugin.py
neutron/tests/unit/db/test_l3_dvr_db.py
neutron/tests/unit/plugins/ml2/test_plugin.py