Skip to content

Commit

Permalink
[sfpshow][recycle_port] sfpshow script needs to skip recycle ports (#…
Browse files Browse the repository at this point in the history
…2109)

Signed-off-by: mlok <marty.lok@nokia.com>
  • Loading branch information
mlok-nokia committed Mar 22, 2022
1 parent 4681697 commit 61b1396
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/sfpshow
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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'))
Expand Down

0 comments on commit 61b1396

Please sign in to comment.