Try to reuse existing IPs when a port update specifies subnet
If a port update specifies only a subnet_id for a fixed_ip then we
want to look at existing fixed_ips to see if that subnet_id is already
there. This avoids allocating a new IP address on the subnet and
deallocating the old one.
Without some special care, this breaks the code path for prefix
delegation. One could argue that PD needs reworking. However, as a
stop-gap measure, we still run the old code path if the address is an
EUI-64 address. This allows PD to continue to work as it was
originally written and it doesn't do any harm because allocating
EUI-64 addresses is repeatable.
This commit removes a test case from the DNS integration tests. The
test was specifically testing that DNS records we updated in the case
where a subnet id was passed to re-allocate a fixed_ip. Since the use
case no longer works, the test doesn't make sense.
This commit also preserves the ability to add an additional IP from a
subnet for which the port already has IPs.
Reviewed: https:/ /review. openstack. org/374689 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=c201439a94d 9249d1c3aefbf40 4304ffa1690be0
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit c201439a94d9249 d1c3aefbf404304 ffa1690be0
Author: Carl Baldwin <email address hidden>
Date: Mon Sep 12 15:31:08 2016 -0600
Try to reuse existing IPs when a port update specifies subnet
If a port update specifies only a subnet_id for a fixed_ip then we
want to look at existing fixed_ips to see if that subnet_id is already
there. This avoids allocating a new IP address on the subnet and
deallocating the old one.
Without some special care, this breaks the code path for prefix
delegation. One could argue that PD needs reworking. However, as a
stop-gap measure, we still run the old code path if the address is an
EUI-64 address. This allows PD to continue to work as it was
originally written and it doesn't do any harm because allocating
EUI-64 addresses is repeatable.
This commit removes a test case from the DNS integration tests. The
test was specifically testing that DNS records we updated in the case
where a subnet id was passed to re-allocate a fixed_ip. Since the use
case no longer works, the test doesn't make sense.
This commit also preserves the ability to add an additional IP from a
subnet for which the port already has IPs.
Change-Id: Iba5d54efa7f99e d82275ffc8e5be9 75b373c29d3 8606fc11d33800a f90a0b1859)
Related-Bug: #1622616
Closes-Bug: #1625334
(cherry picked from commit 14fee9cfcc81612