yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #08030
[Bug 1267148] [NEW] ResponseSerializer shows incorrect 'expires_at' on a task at the time of creation
Public bug reported:
At the time of creation of a task, 'expires_at' is not set by the controller leaving it for the executor to set it once the import succeeds or fails.
However, when a task is created via POST on /tasks, the json response returned contains 'expires_at' field with a non-None value. Ideally, 'expires_at' shouldn't be shown on the response returned by POST on /tasks.
Upon further investigation, we found the culprit to be ReponseSerializer of tasks resource.
At https://github.com/openstack/glance/blob/master/glance/api/v2/tasks.py#L220, 'task.expires_at' is going to be None right after a task is created. But, 'timeutils.isotime' upon getting a None argument, will return the current time. As a result, 'expires_at' is seen in the response with a non-None value.
** Affects: glance
Importance: Medium
Assignee: Hemanth Makkapati (hemanth-makkapati)
Status: Triaged
** Changed in: glance
Assignee: (unassigned) => Hemanth Makkapati (hemanth-makkapati)
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1267148
Title:
ResponseSerializer shows incorrect 'expires_at' on a task at the time
of creation
Status in OpenStack Image Registry and Delivery Service (Glance):
Triaged
Bug description:
At the time of creation of a task, 'expires_at' is not set by the controller leaving it for the executor to set it once the import succeeds or fails.
However, when a task is created via POST on /tasks, the json response returned contains 'expires_at' field with a non-None value. Ideally, 'expires_at' shouldn't be shown on the response returned by POST on /tasks.
Upon further investigation, we found the culprit to be ReponseSerializer of tasks resource.
At https://github.com/openstack/glance/blob/master/glance/api/v2/tasks.py#L220, 'task.expires_at' is going to be None right after a task is created. But, 'timeutils.isotime' upon getting a None argument, will return the current time. As a result, 'expires_at' is seen in the response with a non-None value.
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1267148/+subscriptions
Follow ups
References