cannot use plus sign in flavorid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Amit Uniyal |
Bug Description
We want the flavor name and flavor id to have the same value. This was working fine until we added a flavor name with '+'.
In the code [1], the flavor id is restricted to '^(?! )[a-zA-Z0-9. _-]+(?<! )$'. Although the comment above that code says 'forbid leading/trailing whitespace' -- it is restricting more than the whitespace. In the api-ref [2] for creating a flavor, the id is described as "The ID of the flavor. While people often make this look like an int, this is really a string. If not provided, this defaults to a uuid."
I haven't seen anything that explicitly indicates that plus signs are not allowed, so it seems to me that this is a coding bug and that the plus sign (and perhaps other characters) ought to be allowed as part of the flavorid value.
eg, try creating a flavor name & id with 'this+that':
$ openstack flavor create 'this+that' --id 'this+that'
BadRequestExcep
Tested against master branch (of nova and openstackclient).
[1] https:/
[2] https:/
Changed in nova: | |
assignee: | nobody → Amit Uniyal (auniyal) |
We don't allow the plus sign as you saw in https:/ /opendev. org/openstack/ nova/src/ commit/ 50f48400483f9cb 66b323920ccf1ea 40b0fd0cd1/ nova/api/ openstack/ compute/ schemas/ flavor_ manage. py#L31 so we should then update the API docs to tell the accepted values.
Accepting it as a doc bugfix, not for telling yes for modifying the API as it would need a new microversion (and a spec)