]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
check_grid.py: print stderr when a subcommand fails
authorBrian Warner <warner@lothar.com>
Tue, 23 Jun 2009 02:28:33 +0000 (19:28 -0700)
committerBrian Warner <warner@lothar.com>
Tue, 23 Jun 2009 02:28:33 +0000 (19:28 -0700)
src/allmydata/test/check_grid.py

index 67ffd30619de21a3186e764be9d2ee0d9c8b90ff..b1deea0facb7ed433da9957792e293248a407f85 100644 (file)
@@ -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