Fix usage of ProcessExecutionError exception

Commit 2d9a89a065
made changes to Manila, where it uses 'ssh_execute' function
from common code. But exception that is used was not changed.
So, set old exception as link to new one.

Change-Id: If266f07b4c93c50f59f09336b766ce8f8e415509
Closes-Bug: #1340684
This commit is contained in:
Valeriy Ponomaryov 2014-07-11 07:51:50 -04:00
parent 310cbf42e2
commit e19ca4eb15

View File

@ -27,8 +27,8 @@ import six
from sqlalchemy import exc as sqa_exc from sqlalchemy import exc as sqa_exc
import webob.exc import webob.exc
from manila.openstack.common import log as logging from manila.openstack.common import log as logging
from manila.openstack.common import processutils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -42,6 +42,9 @@ CONF = cfg.CONF
CONF.register_opts(exc_log_opts) CONF.register_opts(exc_log_opts)
ProcessExecutionError = processutils.ProcessExecutionError
class ConvertedException(webob.exc.WSGIHTTPException): class ConvertedException(webob.exc.WSGIHTTPException):
def __init__(self, code=0, title="", explanation=""): def __init__(self, code=0, title="", explanation=""):
self.code = code self.code = code
@ -50,25 +53,6 @@ class ConvertedException(webob.exc.WSGIHTTPException):
super(ConvertedException, self).__init__() super(ConvertedException, self).__init__()
class ProcessExecutionError(IOError):
def __init__(self, stdout=None, stderr=None, exit_code=None, cmd=None,
description=None):
self.exit_code = exit_code
self.stderr = stderr
self.stdout = stdout
self.cmd = cmd
self.description = description
if description is None:
description = _('Unexpected error while running command.')
if exit_code is None:
exit_code = '-'
message = _('%(description)s\nCommand: %(cmd)s\n'
'Exit code: %(exit_code)s\nStdout: %(stdout)r\n'
'Stderr: %(stderr)r') % locals()
IOError.__init__(self, message)
class Error(Exception): class Error(Exception):
pass pass