Bug 861426 - Deleting a non-existent binding returns a 200 instead of a 404
Summary: Deleting a non-existent binding returns a 200 instead of a 404
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: Master
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-28 15:11 UTC by Jay Dobies
Modified: 2014-11-14 14:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-14 14:37:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2012-09-28 15:11:37 UTC
I believe this sort of thing should be a 404 since the resource doesn't exist. Example of where I saw it below.


In [17]: pic.DELETE(unbind_url)
Response Body
null
Out[17]: (200, None)

In [18]: pic.DELETE(unbind_url)
Response Body
null
Out[18]: (200, None)

In [19]: unbind_url
Out[19]: '/v2/consumers/hinterlands/bindings/p3/puppet_distributor/'

Comment 1 Ina Panova 2014-11-14 14:37:07 UTC
Seems to be fixed in 2.4 and 2.5

# pulp-admin -u admin -p admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                  m1
Display Name:        m1
Description:         None
Content Unit Counts: 

Id:                  m2
Display Name:        m2
Description:         None
Content Unit Counts: 


# curl -i -H "Accept: application/json" -X DELETE -k -u admin:admin 'https://localhost//pulp/api/v2/consumers/c1/bindings/invalid_repo/yum_distributor/'
HTTP/1.1 404 Not Found
Date: Fri, 14 Nov 2014 14:26:53 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 570
Content-Type: application/json

{"http_request_method": "DELETE", "exception": null, "error_message": "Missing resource(s): repo_id=invalid_repo, distributor_id=yum_distributor", "_href": "/pulp/api/v2/consumers/c1/bindings/invalid_repo/yum_distributor/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"repo_id": "invalid_repo", "distributor_id": "yum_distributor"}}, "description": "Missing resource(s): repo_id=invalid_repo, distributor_id=yum_distributor", "sub_errors": []}, "traceback": null, "resources": {"repo_id": "invalid_repo", "distributor_id": "yum_distributor"}}


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