removeFloatingIp action should return 400 rather than 404 when remove an removed floating ip

Bug #1129719 reported by wangpan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
wangpan

Bug Description

If we remove a floating ip which is not associated with an instance, the response is like this:
HTTP/1.1 404 Not Found
and the body is None.
expected is like this:
HTTP/1.1 400 Bad Request
with body {"badRequest": {"message": "Floating ip 172.0.0.1 is not associated with an instance.", "code": 400}}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/22283

Changed in nova:
assignee: nobody → wangpan (hzwangpan)
status: New → In Progress
Revision history for this message
wangpan (hzwangpan) wrote :

As the suggestion of Mauro S. M. Rodrigues, HTTPUnprocessableEntity is the better response instead of HTTPBadRequest.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/22283
Committed: http://github.com/openstack/nova/commit/5b38c5c6fe57f7b0d3e36a5d0206488fa01106c0
Submitter: Jenkins
Branch: master

commit 5b38c5c6fe57f7b0d3e36a5d0206488fa01106c0
Author: Wangpan <email address hidden>
Date: Tue Feb 19 13:14:06 2013 +0800

    Return proper error messages while disassociating floating IP

    Currently, when a floating IP is not associated with an instance, and if we try
    to disassociate it, a response likes "HTTP/1.1 404 Not Found" will be returned,
    it is not proper, so change it to "HTTP/1.1 422 Unprocessable Entity" with body
    likes '{"computeFault": {"message": "Floating ip 172.24.4.225 is not associated
    with instance a33857af-b18b-4b88-a5cc-7d84c7fd41c8.", "code": 422}}'.

    Fixes bug: #1129719

    Change-Id: I18194ccf59edb5eb2bcd52a65f38d5632fef95d3

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.