Description of problem: https://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/repo/cud.html#update-an-importer-associated-with-a-repository Docs say that an importer associated to a repo can be updated, but in case if there is no repository or importer with the specified IDs it will return 404. Current api in this case returns a call report with 202 response code and the error is visible only in the task information. # curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"importer_config":{"num_units":5}}' 'https://ec2-54-217-78-7.eu-west-1.compute.amazonaws.com/pulp/api/v2/repositories/unexistant_repo/importers/yum_importer/' HTTP/1.1 202 Accepted Date: Thu, 20 Mar 2014 11:16:47 GMT Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 172 Content-Type: application/json {"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/93ea7f3d-347a-4fed-ba7d-dd71db83396b/", "task_id": "93ea7f3d-347a-4fed-ba7d-dd71db83396b"}], "result": null, "error": null} ]# curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://ec2-54-217-78-7.eu-west-1.compute.amazonaws.com/pulp/api/v2/tasks/93ea7f3d-347a-4fed-ba7d-dd71db83396b/'|python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1324 100 1324 0 0 5281 0 --:--:-- --:--:-- --:--:-- 5296 { "_href": "/pulp/api/v2/tasks/93ea7f3d-347a-4fed-ba7d-dd71db83396b/", "_id": { "$oid": "532ace1f6380d1e4b56c74b0" }, "_ns": "task_status", "error": { "code": "PLP0009", "data": { "resources": { "resource_id": "unexistant_repo" } }, "description": "Missing resource(s): resource_id=unexistant_repo", "sub_errors": [] }, "finish_time": 1395314207, "queue": "reserved_resource_worker-0.compute.internal", "start_time": 1395314207, "state": "error", "tags": [ "pulp:repository:unexistant_repo", "pulp:repository_importer:yum_importer", "pulp:action:update_importer" ], "task_id": "93ea7f3d-347a-4fed-ba7d-dd71db83396b", "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 237, in update_importer_config\n raise MissingResource(repo_id)\nMissingResource: Missing resource(s): resource_id=unexistant_repo\n" } This behaviour is a bit confusing and maybe it would be better if the update call will directly return 404 like in case with distributor update call: # curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{ "distributor_config":{"relative_url":"yyy"}}' 'https://example.com/pulp/api/v2/repositories/unexistant_repo/distributors/yum_distributor/' HTTP/1.1 404 Not Found Date: Thu, 20 Mar 2014 11:21:30 GMT Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 464 Content-Type: application/json { "_href": "/pulp/api/v2/repositories/unexistant_repo/distributors/yum_distributor/", "error": { "code": "PLP0009", "data": { "resources": { "distributor": "yum_distributor" } }, "description": "Missing resource(s): distributor=yum_distributor", "sub_errors": [] }, "error_message": "Missing resource(s): distributor=yum_distributor", "exception": null, "http_request_method": "PUT", "http_status": 404, "resources": { "distributor": "yum_distributor" }, "traceback": null } 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. update unexistant importer(or update importer of unexistant repo) 2. 3. Actual results: Expected results: Additional info:
Same behaviour with : 1)'association of importer to unexistant repo': # curl -i -H "Accept: application/json" -X POST -k -u admin:admin -d '{"importer_type_id":"yum_importer", "importer_config":{}}' 'https://example.com/pulp/api/v2/repositories/unexistant_repo/importers/' HTTP/1.1 202 Accepted Date: Thu, 20 Mar 2014 11:34:01 GMT Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 172 Content-Type: application/json {"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/329aacf1-b8d3-4ec5-92d5-10df8714b1ec/", "task_id": "329aacf1-b8d3-4ec5-92d5-10df8714b1ec"}], "result": null, "error": null} 2) 'disaasociate importer from unexistant repo': # curl -i -H "Accept: application/json" -X DELETE -k -u admin:admin 'https://example.com/pulp/api/v2/repositories/unexistant_repo/importers/yum_importer/' HTTP/1.1 202 Accepted Date: Thu, 20 Mar 2014 11:36:12 GMT Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 172 Content-Type: application/json {"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/69604e28-4485-4978-bade-a89d08092b1a/", "task_id": "69604e28-4485-4978-bade-a89d08092b1a"}], "result": null, "error": null}
see also https://bugzilla.redhat.com/show_bug.cgi?id=1084064
https://github.com/pulp/pulp/pull/1518
Hi, I've checked with pulp-server-2.6.0-0.5.beta.git.93.014a6ca.fc21.noarch and this seems fixed now --- is it expected in the beta build? If that's the case, I'll mark verified...
pulled wrong pulp repo; all is OK
Moved to https://pulp.plan.io/issues/406