summaryrefslogtreecommitdiff
path: root/nova/compute/flavors.py
diff options
context:
space:
mode:
authorjichenjc <jichenjc@cn.ibm.com>2015-08-26 17:13:52 +0800
committerjichenjc <jichenjc@cn.ibm.com>2015-09-20 11:16:19 +0800
commit737c957c8a0e4aa2263c485e5e8007a8bfc3783f (patch)
treeb9e477c28dacf0132f8db660dbc242d505bd1151 /nova/compute/flavors.py
parent2dae8b4c8710cd8a3a327be042669cbf0e881b5d (diff)
downloadnova-737c957c8a0e4aa2263c485e5e8007a8bfc3783f.tar.gz
Remove duplicate VALID_NAME_REGEX
VALID_NAME_REGEX was defined in api/openstack/common and compute/flavors, remove the duplicate definitions. Change-Id: I37175cc3ba11777d9a7508d757433c3dbff0b1a2 Related-Bug: 1431932
Diffstat (limited to 'nova/compute/flavors.py')
-rw-r--r--nova/compute/flavors.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/nova/compute/flavors.py b/nova/compute/flavors.py
index 3ea9c6158d..36e0179191 100644
--- a/nova/compute/flavors.py
+++ b/nova/compute/flavors.py
@@ -51,7 +51,6 @@ LOG = logging.getLogger(__name__)
# create flavor names in locales that use them, however flavor IDs are limited
# to ascii characters.
VALID_ID_REGEX = re.compile("^[\w\.\- ]*$")
-VALID_NAME_REGEX = re.compile(parameter_types.valid_name_regex, re.UNICODE)
# NOTE(dosaboy): This is supposed to represent the maximum value that we can
# place into a SQL single precision float so that we can check whether values
@@ -111,7 +110,7 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb=0, flavorid=None,
utils.check_string_length(name, 'name', min_length=1, max_length=255)
# ensure name does not contain any special characters
- valid_name = VALID_NAME_REGEX.search(name)
+ valid_name = parameter_types.valid_name_regex_obj.search(name)
if not valid_name:
msg = _("Flavor names can only contain printable characters "
"and horizontal spaces.")