diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-11-06 11:46:23 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-11-06 11:46:23 +0000 |
commit | 931892c01470af9d09f4d50faeed5be3bac0c590 (patch) | |
tree | bf80e5ad0507f0d2b42a23f3380783b6a7ede878 /nova/compute | |
parent | ea48828c7e436a3f0710443392ced54ddb5675cb (diff) | |
parent | 831e6013544326e32a1e252917301618c9ea7626 (diff) | |
download | nova-931892c01470af9d09f4d50faeed5be3bac0c590.tar.gz |
Merge "Flavor name should not contain only white spaces"
Diffstat (limited to 'nova/compute')
-rw-r--r-- | nova/compute/flavors.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/compute/flavors.py b/nova/compute/flavors.py index 093dbd478b..4b71303266 100644 --- a/nova/compute/flavors.py +++ b/nova/compute/flavors.py @@ -25,6 +25,7 @@ import sys import uuid from oslo.config import cfg +import six from nova import context from nova import db @@ -87,6 +88,8 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb=0, flavorid=None, 'rxtx_factor': rxtx_factor, } + if isinstance(name, six.string_types): + name = name.strip() # ensure name do not exceed 255 characters utils.check_string_length(name, 'name', min_length=1, max_length=255) |