Bug 1100638
Summary: | Mismatch between binding task search response and task obj initiation | ||
---|---|---|---|
Product: | [Retired] Pulp | Reporter: | dgao |
Component: | API/integration | Assignee: | Barnaby Court <bcourt> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 2.4.0 | CC: | bcourt, bmbouter, jmatthew, jsherril, mhrivnak, pthomas, rbarlow, skarmark |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | 2.4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-09 06:55:01 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
dgao
2014-05-23 09:24:15 UTC
Make sure katello gets notified when this change is done, because it may require a minor change on their side. Michael, what type of change in the output from pulp will occur? The REST API seems to be returning the correct data structure, so I don't think there will be any change required for katello after all. This is probably just a parsing error in our python bindings. Michael, it looks to me that the REST API is in fact not returning the correct data structure: u'spawned_tasks': [u'756345bd-ba30-4f33-b6fc-5da54cf44b0f'] According to our documentation[0], it should return the same structure as retrieving a single task, except wrapped in a list. It is wrapped in a list, but it should be a dictionary with a few attributes, not just a string of the task id. Justin, I propose correcting the API for the task search to return what the documentation says instead. For example, the above would look more like this: "spawned_tasks": [{"href": "/pulp/api/v2/tasks/756345bd-ba30-4f33-b6fc-5da54cf44b0f/", "task_id": "756345bd-ba30-4f33-b6fc-5da54cf44b0f" }] How does that sound? [0] https://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/dispatch/task.html#searching-for-tasks Randy, yeah I'm okay with that change. Would each 'spawned' task include the full task details? (state, progress, etc..) or just those two attributes? Also, if you could get me a heads up of which pulp version this becomes a part of (when you figure it out of course). We'll need to coordinate the change downstream or else this will cause some major breakages :) Hi Justin, The spawned tasks would only include those two attributes, as per the documentation. All of our other task APIs also work this way, which is why we need to make this change. We'll let you know when we know which build this will be part of. Fix included in pulp-server-2.4.0-0.24.beta verified
[root@mgmt3 ~]# rpm -qa pulp-server
pulp-server-2.4.0-0.24.beta.el6.noarch
[root@mgmt3 ~]#
>>> pic.POST('/v2/tasks/search/',body={"criteria": {}})
Request Body
{
"criteria": {}
}
Response Body
[
{
"exception": null,
"task_type": "pulp.server.tasks.repository.sync_with_auto_publish",
"_href": "/pulp/api/v2/tasks/7cf423d2-5224-4967-8f4a-aad016694c07/",
"task_id": "7cf423d2-5224-4967-8f4a-aad016694c07",
"tags": [
"pulp:repository:supplementary",
"pulp:action:sync"
],
"finish_time": "2014-07-14T11:23:58Z",
"_ns": "task_status",
"start_time": "2014-07-14T11:23:57Z",
"traceback": null,
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/7209dd97-fd95-47bd-a153-cfa6c38ebf91/",
"task_id": "7209dd97-fd95-47bd-a153-cfa6c38ebf91"
}
],
This has been fixed in Pulp 2.4.0-1. |