Project

Profile

Help

Issue #756

closed

Api call to get a scheduled sync or publish with invalid schedule_id returns 400

Added by amacdona@redhat.com over 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 GET request to /v2/repositories/<repo_id>/importers/<importer_id>/schedules/sync/<schedule_id>/ returns a 400 if schedule_id is not a valid bson ObjectId.

Since this information is passed in the url, it should instead be a 404.

To reproduce
The schedule id must not be a bson ObjectId.

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

{
    "_href": "/pulp/api/v2/repositories/test/importers/yum_importer/schedules/sync/not_valid_bson_object_id/",
    "error": {
        "code": "PLP0015",
        "data": {
            "properties": "['schedule_ids']",
            "property_names": [
                "schedule_ids"
            ]
        },
        "description": "Invalid properties: ['schedule_ids']",
        "sub_errors": []
    },
    "error_message": "Invalid properties: ['schedule_ids']",
    "exception": null,
    "http_request_method": "GET",
    "http_status": 400,
    "property_names": [
        "schedule_ids"
    ],
    "traceback": null
}

Note
This will be fixed in the Django conversion.

Also available in: Atom PDF