Correct regular expression of volume type extra spec key

The "-" in the regex group has to be the first or the last character,
otherwise it counts as a range.

This is a follow-up patch of https://review.openstack.org/#/c/632204/

Change-Id: I08f80410540cb73f74837fe3ac83bd16f1ae7978
This commit is contained in:
Akihiro Motoki 2019-01-31 14:10:19 +09:00
parent 47b23498d6
commit 4a67f7d79c
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ from horizon import forms
from horizon import messages
KEY_NAME_REGEX = re.compile(r"^[a-zA-Z0-9-_.:]+$", re.UNICODE)
KEY_NAME_REGEX = re.compile(r"^[a-zA-Z0-9_.:-]+$", re.UNICODE)
KEY_ERROR_MESSAGES = {
'invalid': _('Key names can only contain alphanumeric characters, '
'underscores, periods, colons and hyphens')}