From 61b1396a2de409052c7f45e7926b8bd628030463 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:14:57 -0400 Subject: [PATCH] [sfpshow][recycle_port] sfpshow script needs to skip recycle ports (#2109) Signed-off-by: mlok --- scripts/sfpshow | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/sfpshow b/scripts/sfpshow index f61f3ec2ca74..7eb9edaca29b 100755 --- a/scripts/sfpshow +++ b/scripts/sfpshow @@ -13,7 +13,7 @@ import sys import click from natsort import natsorted -from sonic_py_common.interface import front_panel_prefix, backplane_prefix, inband_prefix +from sonic_py_common.interface import front_panel_prefix, backplane_prefix, inband_prefix, recirc_prefix from sonic_py_common import multi_asic from tabulate import tabulate from utilities_common import multi_asic as multi_asic_util @@ -417,7 +417,7 @@ class SFPShow(object): sorted_table_keys = natsorted(port_table_keys) for i in sorted_table_keys: interface = re.split(':', i, maxsplit=1)[-1].strip() - if interface and interface.startswith(front_panel_prefix()) and not interface.startswith(backplane_prefix()) and not interface.startswith(inband_prefix()): + if interface and interface.startswith(front_panel_prefix()) and not interface.startswith((backplane_prefix(), inband_prefix(), recirc_prefix())): presence = self.db.exists(self.db.STATE_DB, 'TRANSCEIVER_INFO|{}'.format(interface)) if presence: self.output += self.convert_interface_sfp_info_to_cli_output_string( @@ -441,7 +441,7 @@ class SFPShow(object): port_table_keys = self.db.keys(self.db.APPL_DB, "PORT_TABLE:*") for i in port_table_keys: key = re.split(':', i, maxsplit=1)[-1].strip() - if key and key.startswith(front_panel_prefix()) and not key.startswith(backplane_prefix()) and not key.startswith(inband_prefix()): + if key and key.startswith(front_panel_prefix()) and not key.startswith((backplane_prefix(), inband_prefix(), recirc_prefix())): presence = self.db.exists(self.db.STATE_DB, 'TRANSCEIVER_INFO|{}'.format(key)) if presence: port_table.append((key, 'Present'))