Project

Profile

Help

Issue #750

closed

Call to remove a nonexisting importer results in a misleading 404 (missing repo)

Added by amacdona@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description
A call to remove a nonexisting importer correctly returns a 404, however the information is misleading. In this case the repo exists, the importer does not, however it suggests that the repo does not exist and makes no mention about the importer.

Actual Results

$ curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X DELETE -k -u admin:admin https://localhost/pulp/api/v2/repositories/test/importers/fake/ | python -mjson.tool

{
    "_href": "/pulp/api/v2/repositories/test/importers/fake/",
    "error": {
        "code": "PLP0009",
        "data": {
            "resources": {
                "repository": "test"
            }
        },
        "description": "Missing resource(s): repository=test",
        "sub_errors": []
    },
    "error_message": "Missing resource(s): repository=test",
    "exception": null,
    "http_request_method": "DELETE",
    "http_status": 404,
    "resources": {
        "repository": "test"
    },
    "traceback": null
}

Expected Results

$ curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X DELETE -k -u admin:admin https://localhost/pulp/api/v2/repositories/test/importers/fake/ | python -mjson.tool

{
    "_href": "/pulp/api/v2/repositories/test/importers/fake/",
    "error": {
        "code": "PLP0009",
        "data": {
            "resources": {
                "repository": "test"
            }
        },
        "description": "Missing resource(s): importer_id=fake",
        "sub_errors": []
    },
    "error_message": "Missing resource(s): importer_id=fake",
    "exception": null,
    "http_request_method": "DELETE",
    "http_status": 404,
    "resources": {
        "repository": "test"
    },
    "traceback": null
}

Note
This problem occurs in the manager so it will not be fixed by the django work.

Also available in: Atom PDF