Actions
Issue #1261
closedPublishing a repository without providing the distributor ID should fail and inform user
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.6.3
Platform Release:
2.7.0
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
Today while playing with the API to publish an existing synchronized YUM repository, I noticed that a new publish task was successfully created even though I failed to provide the distributor id:
POST https://localhost/pulp/api/v2/repositories/animals/actions/publish/
HTTP/1.1 202 Accepted
Connection: Keep-Alive
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json
Date: Fri, 18 Sep 2015 20:55:30 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
{
"error": null,
"result": null,
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/2f70d70f-6002-4fdf-b43f-ad43ac9c8a8d/",
"task_id": "2f70d70f-6002-4fdf-b43f-ad43ac9c8a8d"
}
]
}
When I checked the task itself I saw that there was an error:
"Missing resource(s): distributor=None, repository=animals"
I'd argue that if a required distributor id is not provided while attempting to publish a repository, a validation error should have happened and a new task should not be created
Actions