summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorNikhil Komawar <nikhil.komawar@rackspace.com>2012-04-26 16:55:31 +0000
committerNikhil Komawar <nikhil.komawar@rackspace.com>2012-04-27 16:36:32 +0000
commit79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0 (patch)
tree69f5275b83612e628ec186cd82a138b30d639c57 /nova/api
parenta2249f187caed7c97934cea6fce50ae5360bd0aa (diff)
downloadnova-79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0.tar.gz
nova-79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0.tar.xz
nova-79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0.zip
Added the validation for name check for rebuild of a server
Fixes bug 973591 Change-Id: I3fad8f92dc7aa9ec319fdfb8d1c8df247b84157d
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index 5b0301c8e..251ab769f 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -499,7 +499,7 @@ class Controller(wsgi.Controller):
msg = _("Server name is not a string or unicode")
raise exc.HTTPBadRequest(explanation=msg)
- if value.strip() == '':
+ if not value.strip():
msg = _("Server name is an empty string")
raise exc.HTTPBadRequest(explanation=msg)
@@ -1043,6 +1043,9 @@ class Controller(wsgi.Controller):
if 'accessIPv6' in body:
self._validate_access_ipv6(body['accessIPv6'])
+ if 'name' in body:
+ self._validate_server_name(body['name'])
+
kwargs = {}
for request_attribute, instance_attribute in attr_map.items():