Comment 5 for bug 1775308

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

Reviewed: https://review.openstack.org/573811
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=79a1a113775df87d420b242cea4bbf953df3779c
Submitter: Zuul
Branch: stable/queens

commit 79a1a113775df87d420b242cea4bbf953df3779c
Author: Chris Dent <email address hidden>
Date: Tue Jun 5 18:07:05 2018 -0700

    Ensure resource class cache when listing usages

    In rare circumstances it is possible to list usages in a new placement
    process that has not yet instantiated the _RC_CACHE but for which
    there are inventories and allocations in the database (added by
    other processes running against the same db). Before this change
    that would cause a 500 error (AttributeError) when the Usage objects
    in the UsageList were instantiated.

    The fix is to added _ensure_rc_cache to the two list methods. The
    addition is done there rather than in the _from_db_object as the
    latter would cause a lot of redundant checks.

    While we could probably devise a test for this, it's perhaps good
    enough to evaluate the change by inspection. If not, suggestions
    welcome.

    Change-Id: I00f7dee26f031366dbc0d3d6a03abe89afeb85fd
    Closes-Bug: #1775308
    (cherry picked from commit 724d440122232a5bfdfec51eb0d37ca4f1d748d8)