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.
Reviewed: https:/ /review. openstack. org/484162 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=913149249cc 00f50a6219d3ddc 86f3600a610c00
Committed: https:/
Submitter: Jenkins
Branch: master
commit 913149249cc00f5 0a6219d3ddc86f3 600a610c00
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: I52fa02b56f8e62 dfa206a3969a99f ab250508760
Closes-Bug: #1704574