Return 400 HTTP error for invalid flavor attributes
Currently create flavor API raises 500 error if you
pass large value to ram, disk, vcpu, swap, ephemeral,
rxtx_factor flavor properties. All integral flavor
properties are validated against db.MAX_INT(2147483647)
for maximum limit and raised exception.InvalidInput for
invalid input.
Added validation of maximum limit for flavor properties
in schema. Kept the validation of flavor properties as it
is in nova.compute.flavors as it is used by legacy flavor
create. Moved the SQL_SP_FLOAT_MAX constant to nova.db.api
so that it can be used in schema as well as in test files.
APIImpact: Return 400 status code for invalid flavor
properties.
Reviewed: https:/ /review. openstack. org/313234 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=9e003236218 8d3b4c6ad21881a 08275591461d03
Committed: https:/
Submitter: Jenkins
Branch: master
commit 9e0032362188d3b 4c6ad21881a0827 5591461d03
Author: dineshbhor <email address hidden>
Date: Fri Apr 29 12:46:55 2016 +0000
Return 400 HTTP error for invalid flavor attributes
Currently create flavor API raises 500 error if you INT(2147483647) InvalidInput for
pass large value to ram, disk, vcpu, swap, ephemeral,
rxtx_factor flavor properties. All integral flavor
properties are validated against db.MAX_
for maximum limit and raised exception.
invalid input.
Added validation of maximum limit for flavor properties flavors as it is used by legacy flavor
in schema. Kept the validation of flavor properties as it
is in nova.compute.
create. Moved the SQL_SP_FLOAT_MAX constant to nova.db.api
so that it can be used in schema as well as in test files.
APIImpact: Return 400 status code for invalid flavor
properties.
Closes-Bug: #1577727 c585b6679644e06 ee3569c8c97
Change-Id: I4e50534d67ee90