From 2af15185c622627958493cc93ec6174998c48d8f Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 5 Feb 2009 03:19:30 -0500 Subject: [PATCH 1/1] Get rid of confusing err=True option to invirt.remctl.remctl. svn path=/trunk/packages/invirt-base/; revision=2095 --- debian/changelog | 6 ++++++ python/invirt/common.py | 4 +++- python/invirt/remctl.py | 6 +----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6210c79..2d643b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-base (0.0.21) unstable; urgency=low + + * Get rid of confusing err=True option to invirt.remctl.remctl + + -- Evan Broder Fri, 30 Jan 2009 19:49:46 -0500 + invirt-base (0.0.20) unstable; urgency=low * depend on remctl-client diff --git a/python/invirt/common.py b/python/invirt/common.py index a85d955..eb2e90e 100644 --- a/python/invirt/common.py +++ b/python/invirt/common.py @@ -75,7 +75,9 @@ class InvalidInput(Exception): class CodeError(Exception): """Exception for internal errors or bad faith input.""" - pass + def __init__(self, message, code=None): + Exception.__init__(self, message) + self.code = code # # Tests. diff --git a/python/invirt/remctl.py b/python/invirt/remctl.py index d530d7a..a97e422 100644 --- a/python/invirt/remctl.py +++ b/python/invirt/remctl.py @@ -36,10 +36,6 @@ def remctl(host, *args, **kws): stdout=subprocess.PIPE, stderr=subprocess.PIPE) v = p.wait() - if kws.get('err'): - return p.stdout.read(), p.stderr.read() if v: - print >> sys.stderr, 'Error', v, 'on remctl', args, ':' - print >> sys.stderr, p.stderr.read() - raise CodeError('ERROR on remctl') + raise CodeError('ERROR on remctl %s:\n%s' % (args, p.stderr.read()), v) return p.stdout.read() -- 1.7.9.5