allow delete_port to work when there are multiple floating ips
It is possible to associate multiple floating ip addresses with a single
port through the use of multiple *fixed* ip addresses, e.g.:
nova boot ... --nic net-id=my-net-id myserver
nova add-fixed-ip myserver my-net-id
nova add-floating-ip --fixed-address x.x.x.1 myserver y.y.y.y.1
nova add-floating-ip --fixed-address x.x.x.2 myserver y.y.y.y.2
In this situation, neutron.db.l3_db.disassociate_floatingips would throw
an exception:
Exception: Multiple floating IPs found for port <port-id>
This would prevent someone from deleting an instance that was associated
with multiple floating ips.
This patch corrects disassociate_floatingips so that it will
disassociate all floating ips associated with the port, allowing the
delete operation to proceed correctly.
Conflicts:
neutron/db/l3_db.py
Change-Id: I68a2131fa8ee80828354c9db4ac405c3f77c3b90
Closes-bug: 1302701
(cherry picked from commit bad87ce76ad27f2a4b3c72e26e2eccc2c9564b85)
Reviewed: https:/ /review. openstack. org/133464 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=39736e88a87 a15140309ca39d5 0bffb2327adbaf
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit 39736e88a87a151 40309ca39d50bff b2327adbaf
Author: Lars Kellogg-Stedman <email address hidden>
Date: Fri Apr 4 13:35:32 2014 -0400
allow delete_port to work when there are multiple floating ips
It is possible to associate multiple floating ip addresses with a single
port through the use of multiple *fixed* ip addresses, e.g.:
nova boot ... --nic net-id=my-net-id myserver
nova add-fixed-ip myserver my-net-id
nova add-floating-ip --fixed-address x.x.x.1 myserver y.y.y.y.1
nova add-floating-ip --fixed-address x.x.x.2 myserver y.y.y.y.2
In this situation, neutron. db.l3_db. disassociate_ floatingips would throw
an exception:
Exception: Multiple floating IPs found for port <port-id>
This would prevent someone from deleting an instance that was associated
with multiple floating ips.
This patch corrects disassociate_ floatingips so that it will
disassociate all floating ips associated with the port, allowing the
delete operation to proceed correctly.
Conflicts: db/l3_db. py
neutron/
Change-Id: I68a2131fa8ee80 828354c9db4ac40 5c3f77c3b90 a4b3c72e26e2ecc c2c9564b85)
Closes-bug: 1302701
(cherry picked from commit bad87ce76ad27f2