commit c9620d57c84378c6187485d571e60e9da3eb9737
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: I65bdfadd406368775c794ee4d8a16302a8a134bc
Related-Bug: #1682693
(cherry picked from commit 01dd1a05a213c0cbd0097188418cabe915291c8d)
Reviewed: https:/ /review. openstack. org/457335 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=c9620d57c84 378c6187485d571 e60e9da3eb9737
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit c9620d57c84378c 6187485d571e60e 9da3eb9737
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 bd0097188418cab e915291c8d)
Related-Bug: #1682693
(cherry picked from commit 01dd1a05a213c0c