Skip to content

Commit

Permalink
Fix mc_dump CLI command for SimplePre type (#343)
Browse files Browse the repository at this point in the history
The command implementation was correct for SimplePreLAG but not for
SimplePre, as it assumed the existence of LAG entries in the JSON
returned by the switch.

This addresses issue #342.
  • Loading branch information
antoninbas authored Apr 27, 2017
1 parent 593026c commit ab832df
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/runtime_CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,12 @@ def do_mc_dump(self, line):

print "=========="
print "LAGS"
for lag in mc_json["lags"]:
print "lag({})".format(lag["id"]),
print "-> ports=[{}]".format(", ".join([str(p) for p in ports]))
if "lags" in mc_json:
for lag in mc_json["lags"]:
print "lag({})".format(lag["id"]),
print "-> ports=[{}]".format(", ".join([str(p) for p in ports]))
else:
print "None for this PRE type"
print "=========="

@handle_bad_input
Expand Down

0 comments on commit ab832df

Please sign in to comment.