From 79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0 Mon Sep 17 00:00:00 2001 From: Nikhil Komawar Date: Thu, 26 Apr 2012 16:55:31 +0000 Subject: Added the validation for name check for rebuild of a server Fixes bug 973591 Change-Id: I3fad8f92dc7aa9ec319fdfb8d1c8df247b84157d --- nova/api/openstack/compute/servers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nova/api') 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(): -- cgit