Project

Profile

Help

Issue #412

closed

Association of importer with invalid importer type should return 400

Added by ipanova@redhat.com about 9 years ago. Updated almost 4 years ago.

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

Description

Description of problem:
Association of importer with invalid importer type should return 404, and not a call report that later will fail.

$ curl H "Accept: application/json" -X POST -k -u admin:admin -d '{"importer_type_id": "yum_importer1", "importer_config":{}}' 'https://example.com/pulp/api/v2/repositories/m1/importers/' | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 231 100 172 100 59 126 43 0:00:01 0:00:01 -
:--:-- 126
{
"error": null,
"result": null,
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/0f3e8cbd-ea84-445a-9a1d-b29f6d11e922/",
"task_id": "0f3e8cbd-ea84-445a-9a1d-b29f6d11e922"
}
]
}

$ curl H "Accept: application/json" -X GET -k -u admin:admin 'https://example.com/pulp/api/v2/tasks/0f3e8cbd-ea84-445a-9a1d-b29f6d11e922/' | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1277 100 1277 0 0 1530 0 -
:--:-- --:--:-- --:--:-- 1529
{
"_href": "/pulp/api/v2/tasks/0f3e8cbd-ea84-445a-9a1d-b29f6d11e922/",
"_id": {
"$oid": "533d6e1e3965e4939dfae505"
},
"_ns": "task_status",
"error": {
"code": "PLP0015",
"data": {
"properties": "['importer_type_id']",
"property_names": [
"importer_type_id"
]
},
"description": "Invalid properties: ['importer_type_id']",
"sub_errors": []
},
"finish_time": 1396534814,
"queue": "",
"start_time": 1396534814,
"state": "error",
"tags": [
"pulp:repository:m1",
"pulp:action:add_importer"
],
"task_id": "0f3e8cbd-ea84-445a-9a1d-b29f6d11e922",
"traceback": "Traceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 238, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 369, in call\n return super(Task, self).__call__(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 416, in protected_call\n return self.run(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/pulp/server/managers/repo/importer.py\", line 117, in set_importer\n raise InvalidValue(['importer_type_id'])\nInvalidValue: Invalid properties: ['importer_type_id']\n"
}

Version-Release number of selected component (if applicable):
pulp-server-2.4.0-0.3.alpha.git.13.3215df6.fc20.noarch

How reproducible:
always

Steps to Reproduce:
1. create repo
2. associate importer with invalid importer type
3.

Actual results:
Association of importer with invalid importer type returns 202(a task that fails)

Expected results:
Association of importer with invalid importer type returns 404

Additional info:

+ This bug was cloned from Bugzilla Bug #1084064 +

Also available in: Atom PDF