Skip to content

Commit 61b1396

Browse files
authored
[sfpshow][recycle_port] sfpshow script needs to skip recycle ports (#2109)
Signed-off-by: mlok <[email protected]>
1 parent 4681697 commit 61b1396

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/sfpshow

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import sys
1313

1414
import click
1515
from natsort import natsorted
16-
from sonic_py_common.interface import front_panel_prefix, backplane_prefix, inband_prefix
16+
from sonic_py_common.interface import front_panel_prefix, backplane_prefix, inband_prefix, recirc_prefix
1717
from sonic_py_common import multi_asic
1818
from tabulate import tabulate
1919
from utilities_common import multi_asic as multi_asic_util
@@ -417,7 +417,7 @@ class SFPShow(object):
417417
sorted_table_keys = natsorted(port_table_keys)
418418
for i in sorted_table_keys:
419419
interface = re.split(':', i, maxsplit=1)[-1].strip()
420-
if interface and interface.startswith(front_panel_prefix()) and not interface.startswith(backplane_prefix()) and not interface.startswith(inband_prefix()):
420+
if interface and interface.startswith(front_panel_prefix()) and not interface.startswith((backplane_prefix(), inband_prefix(), recirc_prefix())):
421421
presence = self.db.exists(self.db.STATE_DB, 'TRANSCEIVER_INFO|{}'.format(interface))
422422
if presence:
423423
self.output += self.convert_interface_sfp_info_to_cli_output_string(
@@ -441,7 +441,7 @@ class SFPShow(object):
441441
port_table_keys = self.db.keys(self.db.APPL_DB, "PORT_TABLE:*")
442442
for i in port_table_keys:
443443
key = re.split(':', i, maxsplit=1)[-1].strip()
444-
if key and key.startswith(front_panel_prefix()) and not key.startswith(backplane_prefix()) and not key.startswith(inband_prefix()):
444+
if key and key.startswith(front_panel_prefix()) and not key.startswith((backplane_prefix(), inband_prefix(), recirc_prefix())):
445445
presence = self.db.exists(self.db.STATE_DB, 'TRANSCEIVER_INFO|{}'.format(key))
446446
if presence:
447447
port_table.append((key, 'Present'))

0 commit comments

Comments
 (0)