Skip to content

Commit

Permalink
sonic-utilities: Fixing traceback for show vlan brief (sonic-net#358)
Browse files Browse the repository at this point in the history
* Fixing `show vlan brief` traceback

       Signed-off-by: Stegen Smith <stegen@owns.com>
  • Loading branch information
mslocrian authored and jleveque committed Oct 25, 2018
1 parent e3a2feb commit f693946
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,14 @@ def brief(verbose):
# vlan_dhcp_helper_dict={}, vlan_ip_dict = {}, vlan_ports_dict = {}
for key in natsorted(vlan_dhcp_helper_dict.keys()):
dhcp_helpers = ','.replace(',', '\n').join(vlan_dhcp_helper_dict[key])
ip_address = ','.replace(',', '\n').join(vlan_ip_dict[key])
vlan_ports = ','.replace(',', '\n').join((vlan_ports_dict[key]))
if key not in vlan_ip_dict:
ip_address = ""
else:
ip_address = ','.replace(',', '\n').join(vlan_ip_dict[key])
if key not in vlan_ports_dict:
vlan_ports = ""
else:
vlan_ports = ','.replace(',', '\n').join((vlan_ports_dict[key]))
body.append([key, ip_address, vlan_ports, dhcp_helpers])
click.echo(tabulate(body, header, tablefmt="grid"))

Expand Down

0 comments on commit f693946

Please sign in to comment.