summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-13 19:50:03 +0000
committerGerrit Code Review <review@openstack.org>2013-02-13 19:50:03 +0000
commit787e334a105c47bb387dc51c8798b4ac8e1d7bc0 (patch)
tree4790e1037c69a189be5cc48af8c5dfc28b5a324b /nova/compute
parent07e0c2421adf14d01389f5d6692ac2e18b8b7134 (diff)
parent2c1bb9efd9287381f16979899bf25022822bf95b (diff)
Merge "Check the length of flavor name in "flavor-create""
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/instance_types.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py
index 045a24d4d..4cc5d5d4e 100644
--- a/nova/compute/instance_types.py
+++ b/nova/compute/instance_types.py
@@ -86,6 +86,9 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb=None, flavorid=None,
'rxtx_factor': rxtx_factor,
}
+ # ensure name do not exceed 255 characters
+ utils.check_string_length(name, 'name', min_length=1, max_length=255)
+
# ensure name does not contain any special characters
invalid_name = INVALID_NAME_REGEX.search(name)
if invalid_name: