Bug 1290783 - Response [204] when you delete non-existent tag from tags collection
Response [204] when you delete non-existent tag from tags collection
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: GA
: 5.6.0
Assigned To: Tim Wade
Taras Lehinevych
Depends On:
  Show dependency treegraph
Reported: 2015-12-11 07:59 EST by Taras Lehinevych
Modified: 2016-08-02 21:33 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-06-29 11:19:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Taras Lehinevych 2015-12-11 07:59:38 EST
Description of problem:
When you perform delete action twice for the same tag, you get the incorrect second response 204, should be 404
The same case when you perform the delete method via post request for non existent tag.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
First case:
1. Call delete method for any tag from tags collection a few times
 https://ip_address/api/tags/<tag_id> {'action': u'delete'}
2. Check the responses

Second case:
1. Call post method for tags collection
{'action': u'delete', 'resources': [{'href': 'https://ip_address/api/tags/<tag_id>'}]} 
<tag_id> choose non existent id, for example 20000
2. Check the response

Actual results:
You get 204 response code and it doesn't matter how many time you are going to perform delete method for the same tag

Expected results:
First case:
You should get 404 response code at second attempt to delete tag, that server has not found anything matching the URI given, because the tag with <tag_id> specified in the request should be deleted.

Second case: 
You should get 404 response code, that server has not found anything matching the URI given, because tag with such id doesn't exist.

Additional info:
Other collections have the behavior described in Expected Result.
Comment 2 Tim Wade 2016-01-05 13:08:48 EST
PR: https://github.com/ManageIQ/manageiq/pull/6041
Comment 3 Taras Lehinevych 2016-04-20 12:10:34 EDT
Verified in
Comment 5 errata-xmlrpc 2016-06-29 11:19:49 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.