Bug 1092417 - Unassociation of units from non existent repo should return 404
Summary: Unassociation of units from non existent repo should return 404
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks: 1092424
TreeView+ depends on / blocked
 
Reported: 2014-04-29 09:24 UTC by Ina Panova
Modified: 2015-02-28 22:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:05:13 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 419 0 None None None Never

Description Ina Panova 2014-04-29 09:24:21 UTC
Description of problem:
https://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/content/associate.html#unassociating-content-units-from-a-repository

Unassociation of content units from repo that does not exist should return 404(like in case of unit association to non existant repo) and not call report with task creation.

$ curl -H "Accept: application/json" -X POST  -k -u admin:admin -d '{"criteria": {"type_ids": ["rpm"], "filters": {"unit": {"name": "cat"}}}}' 'https://example.com/pulp/api/v2/repositories/invalidrepo/actions/unassociate/'| python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   245  100   172  100    73    110     46  0:00:01  0:00:01 --:--:--   110
{
    "error": null,
    "result": null,
    "spawned_tasks": [
        {
            "_href": "/pulp/api/v2/tasks/610fff11-3076-4528-83a4-fa150ea66239/",
            "task_id": "610fff11-3076-4528-83a4-fa150ea66239"
        }
    ]
}

Compare with unit association to non existent repo:

$ curl -H "Accept: application/json" -X POST  -k -u admin:admin -d '{"source_repo_id": "xxx", "override_config": {}, "criteria": {"type_ids": ["rpm"], "filters": {"unit": {}}}}' 'https://example.com/pulp/api/v2/repositories/invalidrepo/actions/associate/'|python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   526  100   418  100   108    459    118 --:--:-- --:--:-- --:--:--   459
{
    "_href": "/pulp/api/v2/repositories/invalidrepo/actions/associate/",
    "error": {
        "code": "PLP0009",
        "data": {
            "resources": {
                "repo_id": "invalidrepo"
            }
        },
        "description": "Missing resource(s): repo_id=invalidrepo",
        "sub_errors": []
    },
    "error_message": "Missing resource(s): repo_id=invalidrepo",
    "exception": null,
    "http_request_method": "POST",
    "http_status": 404,
    "resources": {
        "repo_id": "invalidrepo"
    },
    "traceback": null


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ina Panova 2014-04-29 09:28:33 UTC
Version-Release number of selected component: 2.4.0-0.10.beta

Comment 2 Brian Bouterse 2015-02-28 22:05:13 UTC
Moved to https://pulp.plan.io/issues/419


Note You need to log in before you can comment on or make changes to this bug.