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.
Reviewed: https:/ /review. openstack. org/149767 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=939f5582261 5bb352d86d575fb df50337be6c8a8
Committed: https:/
Submitter: Jenkins
Branch: master
commit 939f55822615bb3 52d86d575fbdf50 337be6c8a8
Author: Salvatore Orlando <email address hidden>
Date: Fri Jan 23 13:51:15 2015 -0800
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: I1c4ca6f677845f 6e2e8d88f3629c0 e91ca73b5d0