diff options
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/hosts.py | 8 |
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) |
