diff options
| author | Nikhil Komawar <nikhil.komawar@rackspace.com> | 2012-04-26 16:55:31 +0000 |
|---|---|---|
| committer | Nikhil Komawar <nikhil.komawar@rackspace.com> | 2012-04-27 16:36:32 +0000 |
| commit | 79548ebc7786d8d9d5405fcc5b0be4abb5f5d5c0 (patch) | |
| tree | 69f5275b83612e628ec186cd82a138b30d639c57 /nova/api | |
| parent | a2249f187caed7c97934cea6fce50ae5360bd0aa (diff) | |
| download | nova-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.py | 5 |
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(): |
