Project

Profile

Help

Issue #749

closed

API call to /repositories/repo_id/importers/importer_id/ with incorrect importer id returns a 200

Added by amacdona@redhat.com over 9 years ago. Updated over 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

Summary
Since each repository can only have a single importer, the manager only uses the repo_id to get the importer. However, since the importer_id is in the url, a 404 should be returned if it does not exist.

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

{
    "_id": {
        "$oid": "55005943e138230e5890f837"
    },
    "_ns": "repo_importers",
    "config": null,
    "id": "yum_importer",
    "importer_type_id": "yum_importer",
    "last_sync": null,
    "repo_id": "test",
    "scheduled_syncs": [],
    "scratchpad": null
}

Expected Behavior

$ curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X GET -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": {
                "importer_id": "fake"
            }
        },
        "description": "Missing resource(s): importer_id=fake",
        "sub_errors": []
    },
    "error_message": "Missing resource(s): importer_id=fake",
    "exception": null,
    "http_request_method": "GET",
    "http_status": 404,
    "resources": {
        "importer_id": "fake"
    },
    "traceback": null
}

Note
As indicated in the "expected behavior", this will be fixed in the Django conversion.

Actions #1

Updated by dkliban@redhat.com over 9 years ago

  • Severity set to Medium
  • Triaged changed from No to Yes
  • Platform Release set to 2.7.0
Actions #2

Updated by bmbouter over 9 years ago

  • Severity changed from Medium to 2. Medium

Added by Austin Macdonald over 9 years ago

Revision 089b0f0e | View on GitHub

django conversion - repositories

closes #707 closes #749 closes #756 closes #804 closes #805 closes #812

Added by Austin Macdonald over 9 years ago

Revision 089b0f0e | View on GitHub

django conversion - repositories

closes #707 closes #749 closes #756 closes #804 closes #805 closes #812

Actions #3

Updated by Anonymous over 9 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100
Actions #4

Updated by dkliban@redhat.com over 9 years ago

  • Status changed from MODIFIED to 5
Actions #5

Updated by igulina@redhat.com over 9 years ago

  • Status changed from 5 to 6
>> rpm -qa pulp-server
pulp-server-2.7.0-0.4.beta.el7.noarch

>> curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin https://localhost/pulp/api/v2/repositories/zoopark/importers/no_importer/ | python -mjson.tool
{
    "_href": "/pulp/api/v2/repositories/zoopark/importers/no_importer/",
    "error": {
        "code": "PLP0009",
        "data": {
            "resources": {
                "importer_id": "no_importer"
            }
        },
        "description": "Missing resource(s): importer_id=no_importer",
        "sub_errors": []
    },
    "error_message": "Missing resource(s): importer_id=no_importer",
    "exception": null,
    "http_request_method": "GET",
    "http_status": 404,
    "resources": {
        "importer_id": "no_importer"
    },
    "traceback": null
}

On existing importer:

>> curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin https://localhost/pulp/api/v2/repositories/zoopark/importers/ | python -mjson.tool
[
    {
        "_href": "/pulp/api/v2/repositories/zoopark/importers/yum_importer/",
        "_id": {
            "$oid": "559be5fb77b2943159a2a436"
        },
        "_ns": "repo_importers",
        "config": {
            "feed": "https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/"
        },
        "id": "yum_importer",
        "importer_type_id": "yum_importer",
        "last_sync": null,
        "repo_id": "zoopark",
        "scheduled_syncs": [],
        "scratchpad": null
    }
]

>> curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin https://localhost/pulp/api/v2/repositories/zoopark/importers/yum_importer/ | python -mjson.tool
{
    "_href": "/pulp/api/v2/repositories/zoopark/importers/yum_importer/",
    "_id": {
        "$oid": "559be5fb77b2943159a2a436"
    },
    "_ns": "repo_importers",
    "config": {
        "feed": "https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/"
    },
    "id": "yum_importer",
    "importer_type_id": "yum_importer",
    "last_sync": null,
    "repo_id": "zoopark",
    "scheduled_syncs": [],
    "scratchpad": null
}
Actions #6

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #8

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF