diff options
author | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-07 21:53:40 -0700 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-09-07 21:53:40 -0700 |
commit | fc5e1c6f0bee14fdb85ad138324062ceaa598eee (patch) | |
tree | 88b53210d21cb48f9e2635c19c95e4826b183f0b /nova/exception.py | |
parent | 6591ac066f1c6f7ca74c540fe5f39033fb41cd10 (diff) | |
download | nova-fc5e1c6f0bee14fdb85ad138324062ceaa598eee.tar.gz nova-fc5e1c6f0bee14fdb85ad138324062ceaa598eee.tar.xz nova-fc5e1c6f0bee14fdb85ad138324062ceaa598eee.zip |
a few formatting fixes and moved exception
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) |