Project

Profile

Help

Issue #749

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

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

Associated revisions

Revision 089b0f0e View on GitHub
Added by Austin Macdonald over 6 years ago

django conversion - repositories

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

Revision 089b0f0e View on GitHub
Added by Austin Macdonald over 6 years ago

django conversion - repositories

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

History

#1 Updated by dkliban@redhat.com over 6 years ago

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

#2 Updated by bmbouter over 6 years ago

  • Severity changed from Medium to 2. Medium

#3 Updated by Anonymous over 6 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100

#4 Updated by dkliban@redhat.com over 6 years ago

  • Status changed from MODIFIED to 5

#5 Updated by igulina@redhat.com over 6 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
}

#6 Updated by amacdona@redhat.com almost 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#8 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF