Abandon and Delete API status codes are wrong

Bug #1298518 reported by Steven Hardy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Won't Fix
Medium
Jeff Peeler
openstack-api-site
Fix Released
Undecided
Jeff Peeler

Bug Description

It seems that both stack abandon and delete return the wrong (different!) status codes:

$ curl -i -X DELETE -H 'User-Agent: python-heatclient' -H 'Content-Type: application/octet-stream' -H 'X-Auth-Token: 16ee732ee57b40cb8d696c61e9aa6212' http://localhost:8004/v1/048aeaa4c2714d268d669521d314c304/stacks/empty/1de5bcf8-adb8-4bf3-9088-198599998511
HTTP/1.1 204 No Content
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Date: Thu, 27 Mar 2014 17:17:52 GMT

$ curl -i -X DELETE -H 'User-Agent: python-heatclient' -H 'Content-Type: application/octet-stream' -H 'X-Auth-Token: 16ee732ee57b40cb8d696c61e9aa6212' http://localhost:8004/v1/048aeaa4c2714d268d669521d314c304/stacks/empty/7e84073f-59e1-45c8-8bb9-82914f9cf1c0/abandon
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 175
Date: Thu, 27 Mar 2014 17:18:09 GMT

So they return 204/200 when they should return 202 (HTTPAccepted) as they both start threads to do the delete asynchronously.

Revision history for this message
Steven Hardy (shardy) wrote :

Related, the docs are wrong for adopt (says 204):

http://api.openstack.org/api-ref-orchestration.html

Also it seems there are tests in both heatclient and tempest which expect 204 for delete

Changed in heat:
importance: Undecided → Medium
milestone: none → juno-1
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Well have to assume that users are not checking for exact status codes for successful delete/abandon.

Changed in heat:
status: New → Triaged
Revision history for this message
JunJie Nan (nanjj) wrote :

In the doc:
This operation does not require a request body and does not return a response body.

Well abandon return response body actually

How to correct the doc?

Revision history for this message
Steve Baker (steve-stevebaker) wrote : Re: [Bug 1298518] Re: Abandon and Delete API status codes are wrong

On 04/04/14 14:41, JunJie Nan wrote:
> How to correct the doc?
>
http://git.openstack.org/cgit/openstack/api-site/

Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → juno-2
Jeff Peeler (jpeeler-z)
Changed in heat:
assignee: nobody → Jeff Peeler (jpeeler-z)
Jeff Peeler (jpeeler-z)
Changed in heat:
milestone: juno-2 → juno-3
Jeff Peeler (jpeeler-z)
Changed in heat:
status: Triaged → In Progress
Revision history for this message
Steven Hardy (shardy) wrote :

Hey Jeff, just a heads up, we'll need to temporarily disable a couple of checks for the (wrong) status code in tempest to get the fix through the gate - ping me when you're ready to post a patch and I can help with that if needed

E.g:

https://github.com/openstack/tempest/blob/master/tempest/api/orchestration/stacks/test_stacks.py#L66

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

On 24/07/14 10:35, Steven Hardy wrote:
> Hey Jeff, just a heads up, we'll need to temporarily disable a couple of
> checks for the (wrong) status code in tempest to get the fix through the
> gate - ping me when you're ready to post a patch and I can help with
> that if needed
>
> E.g:
>
> https://github.com/openstack/tempest/blob/master/tempest/api/orchestration/stacks/test_stacks.py#L66
>
Maybe the test should check for both codes during the transition.

Revision history for this message
Jeff Peeler (jpeeler-z) wrote :

It was decided for the v1 API the best approach was to just correct the documentation. Doc review here: https://review.openstack.org/#/c/109371/

Changed in openstack-api-site:
status: New → In Progress
assignee: nobody → Jeff Peeler (jpeeler-z)
Changed in heat:
status: In Progress → Won't Fix
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/109371
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=86673850203c8240f2840c9b3acd79072841db34
Submitter: Jenkins
Branch: master

commit 86673850203c8240f2840c9b3acd79072841db34
Author: Jeff Peeler <email address hidden>
Date: Thu Jul 24 14:04:45 2014 -0400

    Correct stack action abandon response code

    Make the docs match reality: stack abandon returns 200, not 204.

    Closes-Bug: #1298518

    Change-Id: I063a9c793471a546988229de741b89a074dfcb09

Changed in openstack-api-site:
status: In Progress → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → none
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.