Skip to content

Commit

Permalink
Skip INTERFACE entries w/o prefix (sonic-net#477)
Browse files Browse the repository at this point in the history
The two possible key formats of INTERFACE table are:
INTERFACE|<NAME>|<PREFIX>
INTERFACE|<NAME>

The last one carries RIF information without the prefix so it has to be
omitted

Signed-off-by: Marian Pritsak <marianp@mellanox.com>
  • Loading branch information
marian-pritsak authored and prsunny committed Apr 25, 2019
1 parent 6c8e3ad commit 4303b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/pcmping
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def get_portchannel_ipv4(portchannel_name):
config = configdb.get_config()
portchannel_interfaces = config["PORTCHANNEL_INTERFACE"]
for key in portchannel_interfaces.keys():
if len(key) == 1:
continue
pc, ip = key
ip = ip.split("/")[0]
if pc == portchannel_name and ipaddress.IPAddress(ip).version == 4:
Expand Down
2 changes: 2 additions & 0 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,8 @@ def brief(verbose):

# Parsing VLAN Gateway info
for key in natsorted(vlan_ip_data.keys()):
if len(key) == 1:
continue
interface_key = str(key[0].strip("Vlan"))
interface_value = str(key[1])
if interface_key in vlan_ip_dict:
Expand Down

0 comments on commit 4303b19

Please sign in to comment.