ironicclient should display the faultstring returned from api

Bug #1402893 reported by jiangfei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
jiangfei
python-ironicclient
Fix Released
Medium
jiangfei

Bug Description

ironic-api
 curl -i -X GET http://192.0.2.1:6385/v1/nodes/1278a5d7-726a-4f36-b2ed-0807f2bcefb1 -H "User-Agent: python-ironicclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token:ca094934f87148f99645a51ed8c67fe9"
HTTP/1.0 404 Not Found
Date: Tue, 16 Dec 2014 03:01:05 GMT
Server: WSGIServer/0.1 Python/2.7.6
Content-Type: application/json
Content-Length: 153

{"error_message": "{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"Node 1278a5d7-726a-4f36-b2ed-0807f2bcefb1 could not be found.\"}"}

when ironicclient use the HTTPClient, ironic node-show invalid uuid of node. we get the bleow message:

~/ironic# ironic node-show 6cabe4d8-66e4-4598-a614-77a8478d1ad1
Node 6cabe4d8-66e4-4598-a614-77a8478d1ad1 could not be found. (HTTP 404)

but when ironicclient use SessionClient, we get the bleow message:
# ironic node-show a938513a-216a-49dc-b801-08119ebc2b21
Not Found (HTTP 404)

ironic should return the faultstring to user.

jiangfei (jiangfei0622)
Changed in ironic:
assignee: nobody → jiangfei (jiangfei0622)
Dmitry Tantsur (divius)
Changed in ironic:
status: New → Triaged
status: Triaged → Invalid
Changed in python-ironicclient:
status: New → Triaged
importance: Undecided → Medium
jiangfei (jiangfei0622)
Changed in python-ironicclient:
assignee: nobody → jiangfei (jiangfei0622)
Changed in python-ironicclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ironicclient (master)

Reviewed: https://review.openstack.org/142021
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=9f919eed63a95ecbc8d43929c4e81c9f0693ddfb
Submitter: Jenkins
Branch: master

commit 9f919eed63a95ecbc8d43929c4e81c9f0693ddfb
Author: jiangfei <email address hidden>
Date: Tue Dec 16 15:35:53 2014 +0800

    ironicclient handle faultstring when using SessionClient

    When the ironic-api returns an error code 400-600 when,
    SessionClient faultstring did not return to the user,
    it should return a detailed error message to the user,
    not simply bad request.

    we use the ironic node-show aa938513a-216a-49dc-b801-08119ebc2b21
    SessionClient will get the below message:
    "Not Found (HTTP 404)" -->
    "Node a938513a-216a-49dc-b801-08119ebc2b21 could not be
    found. (HTTP 404)"

    Change-Id: If57fd938cdb29d0349b923ca5dc1a804f1accd9d
    Closes-Bug: #1402893

Changed in python-ironicclient:
status: In Progress → Fix Committed
Changed in python-ironicclient:
milestone: none → 0.7.0
status: Fix Committed → Fix Released
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.