diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-24 16:48:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-24 16:48:06 +0000 |
| commit | d785afc48595dada33b1a65ecd9bd9bd240b5a5d (patch) | |
| tree | a3265de643ca211f2801260f5f9f7b3ae23931be /nova/api | |
| parent | bd8a26326c3bbdd8773f7127a4cbad4e5e827120 (diff) | |
| parent | 40753f30b102dce60d5aeead53becc27d0e53f11 (diff) | |
Merge "Check association when removing floating ip."
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/floating_ips.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index 6fb9f0cc1..6e3c24567 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -27,6 +27,7 @@ from nova.compute import utils as compute_utils from nova import exception from nova import network from nova.openstack.common import log as logging +from nova import utils LOG = logging.getLogger(__name__) @@ -282,7 +283,11 @@ class FloatingIPActionController(wsgi.Controller): instance = get_instance_by_floating_ip_addr(self, context, address) # disassociate if associated - if instance and floating_ip.get('fixed_ip_id'): + if (instance and + floating_ip.get('fixed_ip_id') and + (utils.is_uuid_like(id) and + [instance['uuid'] == id] or + [instance['id'] == id])[0]): disassociate_floating_ip(self, context, instance, address) return webob.Response(status_int=202) else: |
