From: Brian Warner Date: Tue, 23 Jun 2009 02:28:33 +0000 (-0700) Subject: check_grid.py: print stderr when a subcommand fails X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/%22doc.html/COPYING.GPL?a=commitdiff_plain;h=f573bb2929f656a62da66e50658dddac6faf4400;p=tahoe-lafs%2Ftahoe-lafs.git check_grid.py: print stderr when a subcommand fails --- 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