From: Quentin Smith Date: Sat, 19 Mar 2011 21:26:21 +0000 (-0400) Subject: Handle remctl results that are larger than a single pipe buffer X-Git-Tag: 0.0.35^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-base.git/commitdiff_plain/HEAD Handle remctl results that are larger than a single pipe buffer --- diff --git a/debian/changelog b/debian/changelog index 5030879..45acfb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-base (0.0.35) unstable; urgency=low + + * Patch from Austin Chu to handle remctl results that are + larger than a single pipe buffer. + + -- Quentin Smith Sat, 19 Mar 2011 17:23:51 -0400 + invirt-base (0.0.34) unstable; urgency=low * Depend on pkg_resources diff --git a/python/invirt/remctl.py b/python/invirt/remctl.py index d530d7a..956ca2d 100644 --- a/python/invirt/remctl.py +++ b/python/invirt/remctl.py @@ -35,11 +35,11 @@ def remctl(host, *args, **kws): + list(args), stdout=subprocess.PIPE, stderr=subprocess.PIPE) - v = p.wait() + stdout, stderr = p.communicate() 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() + return stdout, stderr + if p.returncode: + print >> sys.stderr, 'Error', p.returncode, 'on remctl', args, ':' + print >> sys.stderr, stderr raise CodeError('ERROR on remctl') - return p.stdout.read() + return stdout