Project

Profile

Help

Issue #746

closed

API - update a repository with invalid importer config returns 404 and misleading error

Added by amacdona@redhat.com about 9 years ago. Updated about 5 years ago.

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

Description

Description

Response implies that the repo_id is not found, when it is actually the importer_config that is causing the problem. Since this data was passed in the body rather than the url, this should be a 400 and the importer_config should be the invalid param.

Steps to reporoduce
test4 is a valid repository

curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -d '{"importer_config": {}}' -D- -k -u admin:admin https://localhost/pulp/api/v2/repositories/test4/

HTTP/1.1 404 Not Found
Date: Tue, 10 Mar 2015 18:50:38 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1k-fips mod_wsgi/4.3.2 Python/2.7.8
Content-Encoding: utf-8
Content-Length: 385
Content-Type: application/json

{"http_request_method": "PUT", "exception": null, "error_message": "Missing resource(s): resource_id=test4", "_href": "/pulp/api/v2/repositories/test4/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"resource_id": "test4"}}, "description": "Missing resource(s): resource_id=test4", "sub_errors": []}, "traceback": null, "resources": {"resource_id": "test4"}}

This problem will be unaffected by the Django work because it occurs in the manager:
https://github.com/pulp/pulp/blob/master/server/pulp/server/managers/repo/importer.py#L250

Also available in: Atom PDF