Comment 2 for bug 1704574

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

Reviewed: https://review.openstack.org/484162
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=913149249cc00f50a6219d3ddc86f3600a610c00
Submitter: Jenkins
Branch: master

commit 913149249cc00f50a6219d3ddc86f3600a610c00
Author: Chris Dent <email address hidden>
Date: Sat Jul 15 18:49:57 2017 +0100

    [placement] fix 500 error when allocating to bad class

    Adjust exception handling when calling set_allocations so that a
    KeyError in the usage_map raises an InvalidInventory. When making
    allocations against a resource provider with >1 resource classes
    and where one of those resource classes does not have inventory on the
    provider, we can attempt to get info out of the usage_map that is not
    there, and get a KeyError. This catches the KeyError and turns it into
    an InvalidInventory which eventually results in a 409 response,
    consistent with other responses to bad allocations. Since this is fixing
    a 500, no microversion required.

    Change-Id: I52fa02b56f8e62dfa206a3969a99fab250508760
    Closes-Bug: #1704574