From f573bb2929f656a62da66e50658dddac6faf4400 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Mon, 22 Jun 2009 19:28:33 -0700
Subject: [PATCH] check_grid.py: print stderr when a subcommand fails

---
 src/allmydata/test/check_grid.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/allmydata/test/check_grid.py b/src/allmydata/test/check_grid.py
index 67ffd306..b1deea0f 100644
--- a/src/allmydata/test/check_grid.py
+++ b/src/allmydata/test/check_grid.py
@@ -79,7 +79,7 @@ class GridTester:
         self.nodedir = config.nodedir
 
     def command(self, *cmd, **kwargs):
-        expected_rc = kwargs.get("expected_rc", None)
+        expected_rc = kwargs.get("expected_rc", 0)
         stdin = kwargs.get("stdin", None)
         if self.config["no"]:
             return
@@ -96,6 +96,9 @@ class GridTester:
             (stdout,stderr) = p.communicate()
         rc = p.returncode
         if expected_rc != None and rc != expected_rc:
+            if stderr:
+                print "STDERR:"
+                print stderr
             raise CommandFailed("command '%s' failed: rc=%d" % (cmd, rc))
         return stdout, stderr
 
-- 
2.45.2