task-create API accepts empty dictionary as a input
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
New
|
Undecided
|
Pooja Jadhav |
Bug Description
User can create a task by passing empty dictionary ({}) as input to task-create api. Initially it shows task status a pending but when user tries to get detail of that task using task-show it shows message as "Input does not contain 'import_from' field" with status as failure, and that task will expired after 48 hrs and marked as deleted.
Even though it’s admin api, the failure task will never be used so IMO it should not create a task with empty dictionary for input and rejects the same with HTTPBadRequest.
Steps to reproduce :
1. Create task by passing empty input parameter:
$ glance task-create --type import --input {}
| Property | Value |
| created_at | 2016-11-
| id | f19d6a47-
| input | {} |
| message | |
| owner | 0ab69bb5b73f40d
| result | None |
| status | pending |
| type | import |
| updated_at | 2016-11-
2. Display the created task:
$ glance task-show f19d6a47-
| Property | Value |
| created_at | 2016-11-
| expires_at | 2016-11-
| id | f19d6a47-
| input | {} |
| message | Input does not contain 'import_from' field |
| owner | 0ab69bb5b73f40d
| result | None |
| status | failure |
| type | import |
| updated_at | 2016-11-
Changed in glance: | |
assignee: | nobody → Pooja Jadhav (poojajadhav) |
Hi, i am trying to reproduce the bug after creating task with empty dictionary but my task is in pending state.
glance task-show 3232c8db- 367a-4301- 89c2-e71759b355 b8 ------+ ------- ------- ------- ------- ------- ---+ ------+ ------- ------- ------- ------- ------- ---+ 29T06:49: 51Z | 367a-4301- 89c2-e71759b355 b8 | 19a12a2b4727f85 c9 | 29T06:49: 51Z | ------+ ------- ------- ------- ------- ------- ---+
+------
| Property | Value |
+------
| created_at | 2018-05-
| id | 3232c8db-
| input | {} |
| message | |
| owner | 6cbe607cf163480
| result | None |
| status | pending |
| type | import |
| updated_at | 2018-05-
+------