Inconsistence in what is returned by the Ironic API when setting the power or provision states

Bug #1270160 reported by Lucas Alvares Gomes
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

There's an incosistence in the Ironic API when the user is setting the power and provision state of a node.

- By setting the node's provision state, the Ironic api would return 202 _without_ a body message.
- By setting the node's power state, the Ironic api would return 202 _with_ a body mesage containing the current and target states of that node from the db.*

* The information returned is not updated, it's retuning the same values in the db of when the method was called.

I think that the right thing to do would be to just return 202 without a body message, and in the Location header of the resposne we would include a link to the /nodes/<uuid>/states subresource so that clients know how to track the status of the request.

ps*: Currently returning the Header Location is not supported by WSME, see: https://bugs.launchpad.net/wsme/+bug/1233687

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

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

Changed in ironic:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
status: New → In Progress
aeva black (tenbrae)
Changed in ironic:
importance: Undecided → Medium
aeva black (tenbrae)
Changed in ironic:
milestone: none → icehouse-3
Revision history for this message
aeva black (tenbrae) wrote :

Fix proposed to python-ironicclient:
  https://review.openstack.org/73170

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

Reviewed: https://review.openstack.org/67506
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=4676d823a8a3558aaa07161ab8a1476ef62c5bc2
Submitter: Jenkins
Branch: master

commit 4676d823a8a3558aaa07161ab8a1476ef62c5bc2
Author: Lucas Alvares Gomes <email address hidden>
Date: Fri Jan 17 14:18:21 2014 +0000

    Fix API inconsistence when changing node's states

    When the request to change the power state is accepted by the server
    (HTTP 202) it shouldn't return any response message, just like the
    request to change the provision state. In the future after WSME add
    the support to edit the Header Location, we should include a link to
    the /nodes/<uuid>/states subresource so that clients know how to
    track the status of the request, there's a FIXME in the code
    mentioning that already.

    The patch also add a check to the provision_state tests to make sure
    the response body has no content.

    Change-Id: I4fb1cd5c226cee2f9e0977e83cf2ffa7786b3b4a
    Closes-Bug: #1270160

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