]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Do not check twice IP allocations for auto-address subnets
authorSalvatore Orlando <salv.orlando@gmail.com>
Fri, 23 Jan 2015 21:51:15 +0000 (13:51 -0800)
committerSalvatore Orlando <salv.orlando@gmail.com>
Wed, 28 Jan 2015 21:21:14 +0000 (13:21 -0800)
commit939f55822615bb352d86d575fbdf50337be6c8a8
tree7433e66be6e3df86cb12441bb834c61ef6a4ca88
parent4143763913096c964e63af9d3789cbb7daa5c32a
Do not check twice IP allocations for auto-address subnets

For auto-address subnets such as those with SLAAC and DHCP_STATELESS
address modes it is ok to delete them even when there are active IP
allocations.

The current logic might trigger unexpected 409 errors if IP
allocations are made on these subnets concurrently with their
deletion.

This patch simply ensures the final check for active IP allocations is
not performed for this class of subnets; since all IP allocations will
be removed anyway, it does not make sense to check whether there are
allocations at all. In fact, doing this check might cause a failure
of the delete operation if an IP allocation is made concurrently.

This patch also factors out the logic for checking whether there are
IP allocations on the subnet to avoid code duplication.

Closes-Bug: #1414199

Change-Id: I1c4ca6f677845f6e2e8d88f3629c0e91ca73b5d0
neutron/db/db_base_plugin_v2.py
neutron/plugins/ml2/plugin.py