← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1434335] Re: Change v2 API server group name validation to use the same validation that the other APIs use

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => kilo-rc1

-- 
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/1434335

Title:
  Change v2 API server group name validation to use the same validation
  that the other APIs use

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  The ServerGroup create v2 API does the following check on the
  requested name for the group:

          if not common.VALID_NAME_REGEX.search(value):
                  msg = _("Invalid format for name: '%s'") % value
                  raise nova.exception.InvalidInput(reason=msg)

  where VALID_NAME_REGEX = re.compile("^(?! )[\w. _-]+(?<! )$",
  re.UNICODE)

  This restricts the name to only allow alphanumeric characters, spaces,
  periods, underscores, and dashes. This is a more restrictive check
  than the other APIs use. For example, the V2 flavor API and the V2.1
  server group API allows any printable character and horizontal
  whitespace.

  This can be confusing to the user who just created a server or a
  flavor with a non alpha-numeric character, but can't do so with a
  server group.

  I had originally opened up bug 1431932 to address this by making the
  error message more verbose to let the user know which characters are
  acceptable for a server group name.

  After going through a round of reviews, it appears that a better
  solution would be to make the behavior of the server group name
  validation the same as the name validation in all the other APIs. It
  looks like server groups was missed as part of the following commit
  https://review.openstack.org/#/c/119741/. The purpose of this commit
  was to make the flavor API and others less restrictive in the
  characters that are accepted for a name.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1434335/+subscriptions


References