Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[show/fgnhg] Fix crash bug (sonic-net#1272)
**- What I did** Fix crashes like the following: ``` Traceback (most recent call last): File "/usr/local/bin/show", line 10, in <module> sys.exit(cli()) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/show/fgnhg.py", line 56, in active_hops click.echo(tabulate(table, header, tablefmt="grid")) UnboundLocalError: local variable 'header' referenced before assignment ``` **- How I did it** Define table header outside the loop which processes the rows
- Loading branch information