commit 01dd1a05a213c0cbd0097188418cabe915291c8d
Author: Matt Riedemann <email address hidden>
Date: Sun Apr 16 20:45:25 2017 -0400
Add regression test for server filtering by tags bug 1682693
There was a latent bug in the DB API code such that when we
process filters when listing instances, the various tags
filters have their values popped out of the filters dict and
the values (which are lists) for the filter also have the
first item in the list popped out to build the query.
This latent bug was exposed in Newton when we started listing
instances in the API from both cell0 and the main cell database,
because the query to cell0 would pop an item and then it
would not be in the 2nd query to the main cell database. If we
only had one tag in the filter list, we get an IndexError on
the 2nd pop() call.
Note that we also use the build_requests table in the API to
list instances, but there would not be any tagged servers in
that table since a server has to be ACTIVE before you can tag it,
and build_requests only exist until the instance is put into a
cell and starts building there (so it won't be ACTIVE yet).
Reviewed: https:/ /review. openstack. org/457103 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=01dd1a05a21 3c0cbd009718841 8cabe915291c8d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 01dd1a05a213c0c bd0097188418cab e915291c8d
Author: Matt Riedemann <email address hidden>
Date: Sun Apr 16 20:45:25 2017 -0400
Add regression test for server filtering by tags bug 1682693
There was a latent bug in the DB API code such that when we
process filters when listing instances, the various tags
filters have their values popped out of the filters dict and
the values (which are lists) for the filter also have the
first item in the list popped out to build the query.
This latent bug was exposed in Newton when we started listing
instances in the API from both cell0 and the main cell database,
because the query to cell0 would pop an item and then it
would not be in the 2nd query to the main cell database. If we
only had one tag in the filter list, we get an IndexError on
the 2nd pop() call.
Note that we also use the build_requests table in the API to
list instances, but there would not be any tagged servers in
that table since a server has to be ACTIVE before you can tag it,
and build_requests only exist until the instance is put into a
cell and starts building there (so it won't be ACTIVE yet).
Change-Id: I65bdfadd406368 775c794ee4d8a16 302a8a134bc
Related-Bug: #1682693