Bug 1290783 - Response [204] when you delete non-existent tag from tags collection
Summary: Response [204] when you delete non-existent tag from tags collection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: 5.6.0
Assignee: Tim Wade
QA Contact: Taras Lehinevych
URL:
Whiteboard: rest:tag
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-11 12:59 UTC by Taras Lehinevych
Modified: 2016-08-03 01:33 UTC (History)
4 users (show)

Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 15:19:49 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description Taras Lehinevych 2015-12-11 12:59:38 UTC
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):
5.5.0.13

How reproducible:
Always

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
https://ip_address/api/tags 
{'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 18:08:48 UTC
PR: https://github.com/ManageIQ/manageiq/pull/6041

Comment 3 Taras Lehinevych 2016-04-20 16:10:34 UTC
Verified in 5.6.0.1-beta2

Comment 5 errata-xmlrpc 2016-06-29 15:19:49 UTC
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.

https://access.redhat.com/errata/RHBA-2016:1348


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