In db API when we process filters, we didn't
use deepcopy. In cases of "tags" and "not-tags"
we used pop to get the first tag, filtered out
results, and then joined with other tags for
later filtering. When we did pop(), the original
value was deleted, the key "tags"/"not-tags" remains.
In the cell scenario, both single cell(we will
query cell0 and the other cell) and multicell,
as we have to query all the cells in a loop and
the tags list in the filter will keep popping,
this will lead to either a HTTP 500 error(popping
from an empty list) or incorrect result(when
number of tags in the list is larger than cell
number, no HTTP 500 will show, but the filter
results for each cell will be different as
each loop will pop one tag).
closes-bug: #1682693
Change-Id: Ia2738dd0c7d1842b68c83d0a9e75e26b2f8d492a
(cherry picked from commit c4820305d2f9ee8d62bcc708baf3fa6dfe7ca960)
Reviewed: https:/ /review. openstack. org/457336 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=01ffbdf8be1 cec567ccebb1d9d cb1b390cfaa31a
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 01ffbdf8be1cec5 67ccebb1d9dcb1b 390cfaa31a
Author: Kevin_Zheng <email address hidden>
Date: Fri Apr 14 11:57:59 2017 +0800
Use deepcopy when process filters in db api
In db API when we process filters, we didn't
use deepcopy. In cases of "tags" and "not-tags"
we used pop to get the first tag, filtered out
results, and then joined with other tags for
later filtering. When we did pop(), the original
value was deleted, the key "tags"/"not-tags" remains.
In the cell scenario, both single cell(we will
query cell0 and the other cell) and multicell,
as we have to query all the cells in a loop and
the tags list in the filter will keep popping,
this will lead to either a HTTP 500 error(popping
from an empty list) or incorrect result(when
number of tags in the list is larger than cell
number, no HTTP 500 will show, but the filter
results for each cell will be different as
each loop will pop one tag).
closes-bug: #1682693
Change-Id: Ia2738dd0c7d184 2b68c83d0a9e75e 26b2f8d492a d62bcc708baf3fa 6dfe7ca960)
(cherry picked from commit c4820305d2f9ee8