commit 78e8b7506a7d68089cf08ba24085bf99e070e4ce
Author: Dan Smith <email address hidden>
Date: Wed Apr 7 08:07:05 2021 -0700
Fix image/tasks API for in-progress tasks
A slight error in the tasks_get_by_image() DB API method resulted in
our excluding in-progress tasks from the returned list. This is
because those tasks have expires_at=NULL, and we were comparing
the expires_at>=$NOW to find unexpired tasks. This makes us check for
"NULL or not expired" instead.
We did have a test asserting the wrong behavior, but it was done to
increase coverage and thus was asserting the behavior of the code and
not the *desired* behavior. This fixes that as well.
Closes-Bug: #1922928
Change-Id: I1b6971888673b64ef60bed8fbcc97bbcbcf5c2ac
(cherry picked from commit 2a0d2303c3346b3e771a40c0fe4d4dceaf16f992)
Reviewed: https:/ /review. opendev. org/c/openstack /glance/ +/785420 /opendev. org/openstack/ glance/ commit/ 78e8b7506a7d680 89cf08ba24085bf 99e070e4ce
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit 78e8b7506a7d680 89cf08ba24085bf 99e070e4ce
Author: Dan Smith <email address hidden>
Date: Wed Apr 7 08:07:05 2021 -0700
Fix image/tasks API for in-progress tasks
A slight error in the tasks_get_ by_image( ) DB API method resulted in
our excluding in-progress tasks from the returned list. This is
because those tasks have expires_at=NULL, and we were comparing
the expires_at>=$NOW to find unexpired tasks. This makes us check for
"NULL or not expired" instead.
We did have a test asserting the wrong behavior, but it was done to
increase coverage and thus was asserting the behavior of the code and
not the *desired* behavior. This fixes that as well.
Closes-Bug: #1922928 4ef60bed8fbcc97 bbcbcf5c2ac e771a40c0fe4d4d ceaf16f992)
Change-Id: I1b6971888673b6
(cherry picked from commit 2a0d2303c3346b3