Returns 400 Bad request instead of 200 Ok if flavor name
contains only whitespaces.
Flavor name containing any leading and trailing whitespaces will be
trimmed before validation and before saving it to the backend.
Added unit test cases for both v2 and v3 api's. For v3 api instead of
stubbing flavors 'create' method stubbed db's 'flavor_create' method.
Also removed redundant code of stubbing 'flavor_create' method.
For example
name = " " #not allowed
name = "extra large" #allowed
name = " extra large " #allowed, but leading and trailing whitespaces #will be trimmed (same as instance name)
Reviewed: https:/ /review. openstack. org/50875 github. com/openstack/ nova/commit/ 831e6013544326e 32a1e2529173016 18c9ea7626
Committed: http://
Submitter: Jenkins
Branch: master
commit 831e6013544326e 32a1e2529173016 18c9ea7626
Author: Abhijeet Malawade <email address hidden>
Date: Thu Oct 10 00:00:07 2013 -0700
Flavor name should not contain only white spaces
Returns 400 Bad request instead of 200 Ok if flavor name
contains only whitespaces.
Flavor name containing any leading and trailing whitespaces will be
trimmed before validation and before saving it to the backend.
Added unit test cases for both v2 and v3 api's. For v3 api instead of
stubbing flavors 'create' method stubbed db's 'flavor_create' method.
Also removed redundant code of stubbing 'flavor_create' method.
For example
#will be trimmed (same as instance name)
name = " " #not allowed
name = "extra large" #allowed
name = " extra large " #allowed, but leading and trailing whitespaces
Closes-Bug: #1237611
Change-Id: Ie68be299030a87 8a752dbfdcdfe50 94f8427598a