Skip to content

Commit

Permalink
Fix issue that show dhcp_relay vlan shows only the first dhcp helper
Browse files Browse the repository at this point in the history
      Signed-off-by: Ping Mao <pmao@linkedin.com>

      RB=3132724
      G=lnos-reviewers
      R=pchaudha,pmao,samaity,zxu,stexu,pgohite
      A=zxu,pgohite
  • Loading branch information
li-pingmao committed Feb 3, 2022
1 parent c3de104 commit 6731849
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,11 +1170,11 @@ def vlan(vid, verbose):
body = []
if vid is not None:
vlan = 'Vlan'+str(vid)
if vlan in vlan_dict.keys():
body.append([vlan, vlan_dict[vlan]['dhcp_servers'][0].encode("utf-8")])
if vlan in vlan_dict:
body.append([vlan, '\n'.join(vlan_dict[vlan]['dhcp_servers'] if 'dhcp_servers' in vlan_dict[vlan] else [])])
else:
for vlan in vlan_dict.keys():
body.append([vlan, vlan_dict[vlan]['dhcp_servers'][0].encode("utf-8")])
for vlan in vlan_dict:
body.append([vlan, '\n'.join(vlan_dict[vlan]['dhcp_servers'] if 'dhcp_servers' in vlan_dict[vlan] else [])])

click.echo(tabulate(body, header))

Expand Down

0 comments on commit 6731849

Please sign in to comment.