Comment 3 for bug 1843836

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

Reviewed: https://review.opendev.org/681932
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6ec09de2435fd849ba8123d587cce34e1d8b5ec7
Submitter: Zuul
Branch: master

commit 6ec09de2435fd849ba8123d587cce34e1d8b5ec7
Author: Stephen Finucane <email address hidden>
Date: Thu Sep 12 20:57:15 2019 +0100

    libvirt: Correctly handle non-CPU flag traits

    The 'get_flags_by_flavor_specs' function is intended to return a list of
    CPU flags extracted from flavor extra spec traits, the idea being that
    you can request a specific CPU flag using traits. However, this looks
    through every trait in the image and uses 'dict.get' to try figure out
    if the trait is a CPU flag trait. 'dict.get' returns None if no match is
    found, so we can end up returning 'set([None])'. This isn't false'y,
    which means we end up calling '_match_cpu_model_by_flags' later on and
    *that* fails because 'set([None])' won't be a subset of any CPU model's
    set of flags (no CPU has a 'None' or null flag).

    The solution is easy - don't add the None values.

    Change-Id: I1468ad4b724b8d0e3a855c329bd8c8af513d986c
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1843836