summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorSirisha Devineni <sirisha_devineni@persistent.co.in>2012-09-14 23:04:37 +0530
committerSirisha Devineni <sirisha_devineni@persistent.co.in>2012-09-18 14:30:39 +0530
commitf4906f07cd49e4deae79018d7f586b16266859eb (patch)
tree0408d8bf90f5c35a84ed50541475cc5dda9155f0 /nova/api
parent5fc0dbb912e688c1844856d8d7764ebedf7b6b2d (diff)
downloadnova-f4906f07cd49e4deae79018d7f586b16266859eb.tar.gz
nova-f4906f07cd49e4deae79018d7f586b16266859eb.tar.xz
nova-f4906f07cd49e4deae79018d7f586b16266859eb.zip
Raise BadRequest while creating server with invalid personality
Handle UnicodeDecodeError raises from compute api while trying to create server with invalid personality content and throw it as HTTPBadRequest Fixed bug 1050409 Change-Id: I27d47bbc9ed89abfa9827512fbfb3b16a0d87160
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index c949ad661..d06ebc1e6 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -823,6 +823,9 @@ class Controller(wsgi.Controller):
msg = "%(err_type)s: %(err_msg)s" % {'err_type': err.exc_type,
'err_msg': err.value}
raise exc.HTTPBadRequest(explanation=msg)
+ except UnicodeDecodeError as error:
+ msg = "UnicodeError: %s" % unicode(error)
+ raise exc.HTTPBadRequest(explanation=msg)
# Let the caller deal with unhandled exceptions.
# If the caller wanted a reservation_id, return it