yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #89725
[Bug 1920938] Re: cannot use plus sign in flavorid
Reviewed: https://review.opendev.org/c/openstack/nova/+/858094
Committed: https://opendev.org/openstack/nova/commit/b7356303cdfd9df42b9fea7ab51cb85de7318dad
Submitter: "Zuul (22348)"
Branch: master
commit b7356303cdfd9df42b9fea7ab51cb85de7318dad
Author: Amit Uniyal <auniyal@xxxxxxxxxx>
Date: Fri Sep 16 10:49:09 2022 +0000
Updated flavors doc
Flavor with special characters in flavor ID is not allowed to create
Closes-Bug: 1920938
Change-Id: I600ae07f7fb039c9ccf461c4bf74ae42d9a3744f
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1920938
Title:
cannot use plus sign in flavorid
Status in OpenStack Compute (nova):
Fix Released
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'
BadRequestException: 400: Client Error for url: .../nova_api/v2.1/flavors, Invalid input for field/attribute id. Value: this+that. 'this+that' does not match '^(?! )[a-zA-Z0-9. _-]+(?<! )$'
Tested against master branch (of nova and openstackclient).
[1] https://opendev.org/openstack/nova/src/commit/50f48400483f9cb66b323920ccf1ea40b0fd0cd1/nova/api/openstack/compute/schemas/flavor_manage.py#L31
[2] https://docs.openstack.org/api-ref/compute/?expanded=create-flavor-detail#create-flavor
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1920938/+subscriptions
References