summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorPrem Karat <prem.karat@linux.vnet.ibm.com>2013-05-03 22:36:04 +0530
committerPrem Karat <prem.karat@linux.vnet.ibm.com>2013-06-11 11:03:45 +0530
commit98ff29d13af9e0c1fa96e49e68939634c24ad2c3 (patch)
tree7500247cbcdd67744b1182b11b15e4a25f96e97d /nova/api
parente0142d0f63bf64a07db3bd3b840fc2072d2e6ca3 (diff)
downloadnova-98ff29d13af9e0c1fa96e49e68939634c24ad2c3.tar.gz
nova-98ff29d13af9e0c1fa96e49e68939634c24ad2c3.tar.xz
nova-98ff29d13af9e0c1fa96e49e68939634c24ad2c3.zip
Fix to disallow server name with all blank spaces
* Nova CLI allows server name to be created with all blank characters. This fix will disallow a server name with all blank spaces during server/instance creation as well as while updating/renaming a server * Adding unit tests to test the above scenarios (create & rename server with blank spaces) Fixes bug 1175956 Change-Id: I58af207c4a6b8579bb172d4bb612e0aa2aa6b498
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index 41c3b92a5..f47ac56a7 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -580,6 +580,8 @@ class Controller(wsgi.Controller):
def _check_string_length(self, value, name, max_length=None):
try:
+ if isinstance(value, basestring):
+ value = value.strip()
utils.check_string_length(value, name, min_length=1,
max_length=max_length)
except exception.InvalidInput as e: