From aecea04f22d79524c03f4491223c6fc66e6d62ee Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Mon, 19 Aug 2019 14:29:03 -0700 Subject: [PATCH] Include command output in switch.cmd() exception --- clib/mininet_test_topo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clib/mininet_test_topo.py b/clib/mininet_test_topo.py index 828dc19fd4..eb0c9d56ef 100644 --- a/clib/mininet_test_topo.py +++ b/clib/mininet_test_topo.py @@ -77,7 +77,8 @@ def cmd(self, *args, success=0, **kwargs): cmd_output = super().cmd(*args, **kwargs) exit_code = int(super().cmd('echo $?')) if success is not None and exit_code != success: - raise RuntimeError('%s exited with %d' % (args, exit_code)) + raise RuntimeError( + "%s exited with (%d):'%s'" % (args, exit_code, cmd_output)) return cmd_output def start(self, controllers):