summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-15 20:13:09 +0000
committerGerrit Code Review <review@openstack.org>2013-03-15 20:13:09 +0000
commitb2d35dbf6819318c10801e72fecdc5ea9fb6cb9a (patch)
tree82bc364b0dc094715750b657a377db83fa5d0064 /nova/api
parentdd2a861aaecaef8e533a88b65511a2ed83b091cb (diff)
parentd786517ad1dbd4e59382de241074c5dc454bd365 (diff)
downloadnova-b2d35dbf6819318c10801e72fecdc5ea9fb6cb9a.tar.gz
nova-b2d35dbf6819318c10801e72fecdc5ea9fb6cb9a.tar.xz
nova-b2d35dbf6819318c10801e72fecdc5ea9fb6cb9a.zip
Merge "Fix: improve API error responses from os-hosts extension"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/hosts.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py
index a3b3538fd..3727f35d9 100644
--- a/nova/api/openstack/compute/contrib/hosts.py
+++ b/nova/api/openstack/compute/contrib/hosts.py
@@ -194,7 +194,7 @@ class HostController(object):
msg = _("Virt driver does not implement host maintenance mode.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=e.message)
+ raise webob.exc.HTTPNotFound(explanation=unicode(e))
if result not in ("on_maintenance", "off_maintenance"):
raise webob.exc.HTTPBadRequest(explanation=result)
return result
@@ -214,7 +214,7 @@ class HostController(object):
msg = _("Virt driver does not implement host disabled status.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=e.message)
+ raise webob.exc.HTTPNotFound(explanation=unicode(e))
if result not in ("enabled", "disabled"):
raise webob.exc.HTTPBadRequest(explanation=result)
return result
@@ -230,7 +230,7 @@ class HostController(object):
msg = _("Virt driver does not implement host power management.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=e.message)
+ raise webob.exc.HTTPNotFound(explanation=unicode(e))
return {"host": host_name, "power_action": result}
@wsgi.serializers(xml=HostActionTemplate)
@@ -311,7 +311,7 @@ class HostController(object):
try:
service = self.api.service_get_by_compute_host(context, host_name)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=e.message)
+ raise webob.exc.HTTPNotFound(explanation=unicode(e))
except exception.AdminRequired:
msg = _("Describe-resource is admin only functionality")
raise webob.exc.HTTPForbidden(explanation=msg)