Comment 12 for bug 1682693

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/newton)

Reviewed: https://review.openstack.org/457353
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6d1ce4cf5cfa9525dfde14bd55b94e86f5e548c1
Submitter: Jenkins
Branch: stable/newton

commit 6d1ce4cf5cfa9525dfde14bd55b94e86f5e548c1
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

    Conflicts:
          nova/tests/functional/regressions/test_bug_1682693.py

    NOTE(mriedem): The conflict on the functional regression test
    is due to I65bdfadd406368775c794ee4d8a16302a8a134bc not being
    backported to Newton. That was not backported simply because it
    relies on too many fixtures to stub out a real cells environment
    that trying to get it to work in Newton is not worth it. This
    fix is still unit tested which is sufficient.

    Change-Id: Ia2738dd0c7d1842b68c83d0a9e75e26b2f8d492a
    (cherry picked from commit c4820305d2f9ee8d62bcc708baf3fa6dfe7ca960)
    (cherry picked from commit 01ffbdf8be1cec567ccebb1d9dcb1b390cfaa31a)