From 4eaa167ca992fbc7ac90e43c218be7b2bdf177da Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Thu, 22 Dec 2011 23:16:05 -0800 Subject: Add exit_code, stdout, stderr etc to ProcessExecutionException This means that we can now catch ProcessExecutionException and inspect the result, in order to handle "acceptable" exceptions e.g. file does not exist on a remove Change-Id: I4f5dfe1f1d4601dafc50abc4c61f4b616f13c5ff --- nova/exception.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova/exception.py') diff --git a/nova/exception.py b/nova/exception.py index 345b313f7..043322607 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -50,6 +50,12 @@ def novaclient_converter(f): 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: -- cgit