From: Evan Broder Date: Thu, 5 Feb 2009 08:19:30 +0000 (-0500) Subject: Get rid of confusing err=True option to invirt.remctl.remctl. X-Git-Tag: 0.0.21~4 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-base.git/commitdiff_plain/2af15185c622627958493cc93ec6174998c48d8f Get rid of confusing err=True option to invirt.remctl.remctl. svn path=/trunk/packages/invirt-base/; revision=2095 --- 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()