diff options
author | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-20 19:17:36 -0700 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-20 19:17:36 -0700 |
commit | 026f6f2b7f5457f15a258ebed66bb8dda3263eec (patch) | |
tree | 146dcfe5e69bd4c7bea76e46fa97fbeb39828581 /nova/exception.py | |
parent | c791229d11e3baf2a5828ee8efe98ed827a35dde (diff) | |
parent | d8861d04a85044ae57ffd7eb9ab682879beecf7d (diff) | |
download | nova-026f6f2b7f5457f15a258ebed66bb8dda3263eec.tar.gz nova-026f6f2b7f5457f15a258ebed66bb8dda3263eec.tar.xz nova-026f6f2b7f5457f15a258ebed66bb8dda3263eec.zip |
merged trunk
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index 29bcb17f8..b8894758f 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -26,6 +26,18 @@ import sys import traceback +class ProcessExecutionError(IOError): + def __init__(self, stdout=None, stderr=None, exit_code=None, cmd=None, + description=None): + if description is None: + description = "Unexpected error while running command." + if exit_code is None: + exit_code = '-' + message = "%s\nCommand: %s\nExit code: %s\nStdout: %r\nStderr: %r" % ( + description, cmd, exit_code, stdout, stderr) + IOError.__init__(self, message) + + class Error(Exception): def __init__(self, message=None): super(Error, self).__init__(message) |