summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
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():