From e135f939a40617ef5b5c9847454c2db066eb72cb Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 29 Dec 2011 10:57:38 -0500 Subject: Fixing novaclient_converter NameError bug 909772 Change-Id: Iac7b45648cd1c85fdc3c8febbd0ef69b63a70c92 --- nova/api/openstack/v2/servers.py | 8 -------- nova/exception.py | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/nova/api/openstack/v2/servers.py b/nova/api/openstack/v2/servers.py index 5c62a7f82..d98d532dc 100644 --- a/nova/api/openstack/v2/servers.py +++ b/nova/api/openstack/v2/servers.py @@ -41,14 +41,6 @@ LOG = logging.getLogger('nova.api.openstack.v2.servers') FLAGS = flags.FLAGS -class ConvertedException(exc.WSGIHTTPException): - def __init__(self, code, title, explanation): - self.code = code - self.title = title - self.explanation = explanation - super(ConvertedException, self).__init__() - - class Controller(wsgi.Controller): """ The Server API base controller class for the OpenStack API """ diff --git a/nova/exception.py b/nova/exception.py index 95e34afe2..186a6ac58 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -28,12 +28,21 @@ from functools import wraps import sys from novaclient import exceptions as novaclient_exceptions +import webob.exc from nova import log as logging LOG = logging.getLogger('nova.exception') +class ConvertedException(webob.exc.WSGIHTTPException): + def __init__(self, code=0, title="", explanation=""): + self.code = code + self.title = title + self.explanation = explanation + super(ConvertedException, self).__init__() + + def novaclient_converter(f): """Convert novaclient ClientException HTTP codes to webob exceptions. Has to be the outer-most decorator. -- cgit