Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime_CLI exits when mc_dump command is used #342

Closed
ghost opened this issue Apr 27, 2017 · 3 comments
Closed

runtime_CLI exits when mc_dump command is used #342

ghost opened this issue Apr 27, 2017 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 27, 2017

I was trying the runtime_CLI python script to dump the multicast related information using the mc_dump command. The runtime_CLI seems to exit with the following backtrace:

RuntimeCmd: mc_dump

MC ENTRIES

mgrp(1)
-> (L1h=0, rid=0) -> (ports=[1], lags=[])
-> (L1h=1, rid=1) -> (ports=[2], lags=[])

LAGS
Traceback (most recent call last):
File "behavioral-model/targets/l2_switch/runtime_CLI", line 2216, in
main()
File "behavioral-model/targets/l2_switch/runtime_CLI", line 2213, in main
RuntimeAPI(args.pre, standard_client, mc_client).cmdloop()
File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "behavioral-model/targets/l2_switch/runtime_CLI", line 585, in handle
return f(*args, **kwargs)
File "behavioral-model/targets/l2_switch/runtime_CLI", line 1621, in do_mc_dump
for lag in mc_json["lags"]:
KeyError: 'lags'

Has anyone faced this issue ?

@ghost ghost changed the title runtime_CLI exits when mc_dump is used runtime_CLI exits when mc_dump command is used Apr 27, 2017
@ghost
Copy link
Author

ghost commented Apr 27, 2017

I am not very familiar with the code but tried to debug more, this happens when running l2_switch target which uses SimplePre and hence does not contain lag_entries map in the MCSimplePre class, hence the server does not add lags in the json. However the mc_client at the CLI tries to access lags in the mc_json which it obtains from the server. Hope i got this right

antoninbas added a commit that referenced this issue Apr 27, 2017
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.
@antoninbas
Copy link
Member

Thanks for reporting this issue and taking the time to look at the code. I have opened a pull request for this, which will be merged into master soon.

@antoninbas antoninbas added the bug label Apr 27, 2017
antoninbas added a commit that referenced this issue Apr 27, 2017
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.
antoninbas added a commit that referenced this issue Apr 27, 2017
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.
@ghost
Copy link
Author

ghost commented Apr 28, 2017

Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant