← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1431932] [NEW] Make the server group invalid format message more verbose

 

Public bug reported:

The ServerGroup create 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)

Since other APIs allow non-alphanumeric characters for names, the
"Inavlid format for name" error message is not especially helpful in
letting the caller know what is invalid about the name they requested.

I think a more descriptive/helpful message would be:

msg = _("Invalid format for name: '%s'. Names can only contain
alphanumeric characters, dashes, underscores, periods, and spaces and
cannot begin or end with a space.") % value

** Affects: nova
     Importance: Undecided
     Assignee: Jennifer Mulsow (jmulsow)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Jennifer Mulsow (jmulsow)

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

Title:
  Make the server group invalid format message more verbose

Status in OpenStack Compute (Nova):
  New

Bug description:
  The ServerGroup create 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)

  Since other APIs allow non-alphanumeric characters for names, the
  "Inavlid format for name" error message is not especially helpful in
  letting the caller know what is invalid about the name they requested.

  I think a more descriptive/helpful message would be:

  msg = _("Invalid format for name: '%s'. Names can only contain
  alphanumeric characters, dashes, underscores, periods, and spaces and
  cannot begin or end with a space.") % value

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


Follow ups

References