For now, revert r2093-2095, which were committed by accident; I'm not
[invirt/packages/invirt-base.git] / python / invirt / remctl.py
index a97e422..d530d7a 100644 (file)
@@ -36,6 +36,10 @@ def remctl(host, *args, **kws):
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     v = p.wait()
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
     v = p.wait()
+    if kws.get('err'):
+        return p.stdout.read(), p.stderr.read()
     if v:
     if v:
-        raise CodeError('ERROR on remctl %s:\n%s' % (args, p.stderr.read()), v)
+        print >> sys.stderr, 'Error', v, 'on remctl', args, ':'
+        print >> sys.stderr, p.stderr.read()
+        raise CodeError('ERROR on remctl')
     return p.stdout.read()
     return p.stdout.read()