When user passes only white spaces to flavor name, it creates flavor successfully. Since name is a mandatory parameter, it should restrict user from passing white spaces. Also leading and trailing white spaces should be removed before saving it to the backend similar to the instance name.
{
"flavor": {
"name": " "
"ram": 1024,
"vcpus": 2,
"disk": 10,
"id": "10",
"os-flavor-access:is_public": false
}
}
For example
name = " " #not allowed
name = "extra large" #allowed
name = " extra large " #allowed, but leading and trailing white spaces will be trimmed before saving it to the backend.
Actual output: HTTP/1.1 200 OK
Expected output: HTTP/1.1 400 Bad Request
Fix proposed to branch: master /review. openstack. org/50875
Review: https:/