Bug 861426 - Deleting a non-existent binding returns a 200 instead of a 404
Deleting a non-existent binding returns a 200 instead of a 404
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: API/integration (Show other bugs)
Master
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: pulp-bugs
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-28 11:11 EDT by Jay Dobies
Modified: 2014-11-14 09:37 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-11-14 09:37:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jay Dobies 2012-09-28 11:11:37 EDT
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 09:37:07 EST
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.