← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1920938] [NEW] cannot use plus sign in flavorid

 

Public bug reported:

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

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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):
  New

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


Follow ups