From f24278da73e36efd10196b426a34d6182578cf9c Mon Sep 17 00:00:00 2001 From: pengyuesheng Date: Fri, 25 Jan 2019 10:49:54 +0800 Subject: [PATCH] Modify the flavor ID regex Flavor ID regex and Nova service are inconsistent and need to be modified Change-Id: Ib247cc0cbbf8e340f0ab19002d0010f571b9a33c Closes-Bug: #1813236 --- .../dashboards/admin/flavors/workflows.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/flavors/workflows.py b/openstack_dashboard/dashboards/admin/flavors/workflows.py index c42f9810e8..4826f09d95 100644 --- a/openstack_dashboard/dashboards/admin/flavors/workflows.py +++ b/openstack_dashboard/dashboards/admin/flavors/workflows.py @@ -27,11 +27,10 @@ from openstack_dashboard import api class CreateFlavorInfoAction(workflows.Action): - _flavor_id_regex = (r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' - r'[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9]+|auto$') - _flavor_id_help_text = _("Flavor ID should be UUID4 or integer. " - "Leave this field blank or use 'auto' to set " - "a random UUID4.") + _flavor_id_regex = (r'^[a-zA-Z0-9. _-]+$') + _flavor_id_help_text = _("flavor id can only contain alphanumeric " + "characters, underscores, periods, hyphens, " + "spaces.") name = forms.CharField( label=_("Name"), max_length=255) @@ -39,6 +38,7 @@ class CreateFlavorInfoAction(workflows.Action): regex=_flavor_id_regex, required=False, initial='auto', + max_length=255, help_text=_flavor_id_help_text) vcpus = forms.IntegerField(label=_("VCPUs"), min_value=1)