]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix DBDuplicateEntry when creating port with fixed_ips on PD subnet
authorJohn Davidge <jodavidg@cisco.com>
Thu, 13 Aug 2015 22:08:47 +0000 (23:08 +0100)
committerJohn Davidge <jodavidg@cisco.com>
Thu, 27 Aug 2015 09:08:30 +0000 (09:08 +0000)
commit81b266f2f7c16ae39eaa53381a35f02784216458
tree79c71024fb0c814806322a78eec9d3aa0077d1f3
parent9ed4be7559b1b611b35b505a786c3511dccac58f
Fix DBDuplicateEntry when creating port with fixed_ips on PD subnet

Creating a port on a prefix delegation enabled subnet with a fixed ip
list containing only the subnet id will cause a DBDuplicateEntry error.
This is because the subnet is not treated as an ipv6 auto address subnet
as it should be by _test_fixed_ips_for_port in ipam_non_pluggable_backend.py

All IPV6 PD subnets are auto address subnets, so the additional check was
unnecessary and incorrect in this case.

This patch changes the condition for appending the subnet id to the
fixed_ip_set so that PD subnets are treated the same as auto address
subnets. Also includes a unit test to catch this failure.

Change-Id: I8ad499467a09133258b1e9e40db736d4e1ae62f3
Closes-Bug: 1484379
neutron/db/ipam_non_pluggable_backend.py
neutron/tests/unit/db/test_db_base_plugin_v2.py