diff options
| author | Dan Smith <danms@us.ibm.com> | 2012-07-23 08:20:37 -0700 |
|---|---|---|
| committer | Dan Smith <danms@us.ibm.com> | 2012-07-23 09:20:25 -0700 |
| commit | 07105cb78e366d35dd8c8a046c951780c274e9a2 (patch) | |
| tree | 96ea45ec55fe4a28d1cf16a1d8d5230dc66419fa /nova/api | |
| parent | a9682615879215517231230a87af75ab28a8d974 (diff) | |
| download | nova-07105cb78e366d35dd8c8a046c951780c274e9a2.tar.gz nova-07105cb78e366d35dd8c8a046c951780c274e9a2.tar.xz nova-07105cb78e366d35dd8c8a046c951780c274e9a2.zip | |
Return 404 when attempting to remove a non-existent floating ip
This fixes bug 993774 and returns 404 instead of 202 when trying to
delete a floating ip from an instance to which it is not allocated.
Change-Id: I9538a8a71cbbb9d19e9ebb76f93b180dbf619764
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/floating_ips.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index b6a6adc9e..4b290bb4c 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -282,10 +282,11 @@ class FloatingIPActionController(wsgi.Controller): instance = get_instance_by_floating_ip_addr(self, context, address) # disassociate if associated - if floating_ip.get('fixed_ip_id'): + if instance and floating_ip.get('fixed_ip_id'): disassociate_floating_ip(self, context, instance, address) - - return webob.Response(status_int=202) + return webob.Response(status_int=202) + else: + return webob.Response(status_int=404) class Floating_ips(extensions.ExtensionDescriptor): |
