API returns HTTP 500 when resource is not found

Bug #1200517 reported by Martyn Taylor
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
High
Vitaly Kostenko

Bug Description

Ironic should return a HTTP 404 when resources are not found. Right now 500s are returned throughout the API.

e.g.

$ curl -H "accept: application/json" http://0.0.0.0:6385/v1/nodes/12 -i

HTTP/1.0 500 Internal Server Error
Date: Fri, 12 Jul 2013 07:47:21 GMT
Server: WSGIServer/0.1 Python/2.7.3
Content-Type: application/json
Content-Length: 119

{"error_message": "{\"debuginfo\": null, \"faultcode\": \"Server\", \"faultstring\": \"Node 12 could not be found.\"}"}

aeva black (tenbrae)
Changed in ironic:
status: New → Triaged
importance: Undecided → High
Changed in ironic:
assignee: nobody → Vitaly Kostenko (vitalij-ua)
Revision history for this message
Vitaly Kostenko (vitalij-ua) wrote :

Ironic's code looks ok. Problem appears in WSME, described here https://bugs.launchpad.net/wsme/+bug/1214073.
I've already submit fix. Waiting for review and merge.

Changed in ironic:
status: Triaged → In Progress
Changed in ironic:
status: In Progress → Fix Committed
Revision history for this message
Vitaly Kostenko (vitalij-ua) wrote :

https://github.com/stackforge/wsme/commit/651ad18bdde92e550eee68aa7522288a5de94cdd - this commit to wsme already have solution that solves our problem.

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

Reviewed: https://review.openstack.org/47002
Committed: http://github.com/openstack/ironic/commit/72aebeed640c53d29735d3b2f8f153fee0e23b8c
Submitter: Jenkins
Branch: master

commit 72aebeed640c53d29735d3b2f8f153fee0e23b8c
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Sep 17 18:53:33 2013 +0100

    Fix tests return codes

    WSME 0.5b5 was released fixing the return codes.

    Closes-Bug: #1200517
    Change-Id: Icaffe61dfc8f7124b9e32a8ee77f322ba1578176

Thierry Carrez (ttx)
Changed in ironic:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-1 → 2014.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.