Skip to content

Commit

Permalink
Merge pull request #3190 from lantz/cmd-exception-log-output
Browse files Browse the repository at this point in the history
Include command output in switch.cmd() exception
  • Loading branch information
gizmoguy committed Aug 19, 2019
2 parents 8f22548 + aecea04 commit 2ca0926
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clib/mininet_test_topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2ca0926

Please sign in to comment.