From 4303b19cba698500834163fde6c2754f7e31417f Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Thu, 25 Apr 2019 19:56:05 +0300 Subject: [PATCH] Skip INTERFACE entries w/o prefix (#477) The two possible key formats of INTERFACE table are: INTERFACE|| INTERFACE| The last one carries RIF information without the prefix so it has to be omitted Signed-off-by: Marian Pritsak --- scripts/pcmping | 2 ++ show/main.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/pcmping b/scripts/pcmping index 20bfaea59e55..1f6126327435 100755 --- a/scripts/pcmping +++ b/scripts/pcmping @@ -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: diff --git a/show/main.py b/show/main.py index 2573138fae8a..b853507b62bf 100755 --- a/show/main.py +++ b/show/main.py @@ -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: