Skip to content

Commit

Permalink
Fix issue: exception in is_rj45_port in multi ASIC env (#2313)
Browse files Browse the repository at this point in the history
* Fix issue: exception in is_rj45_port in multi ASIC env
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs authored Aug 18, 2022
1 parent 6fc4f15 commit 7704f63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utilities_common/platform_sfputil_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ def is_rj45_port(port_name):
if not platform_porttab_mapping_read:
platform_sfputil_read_porttab_mappings()

physical_port = logical_port_name_to_physical_port_list(port_name)[0]
try:
port_type = platform_chassis.get_port_or_cage_type(physical_port)
except NotImplementedError as e:
physical_port = logical_port_name_to_physical_port_list(port_name)
if physical_port:
port_type = platform_chassis.get_port_or_cage_type(physical_port[0])
except Exception as e:
port_type = None

return port_type == platform_sfp_base.SFP_PORT_TYPE_BIT_RJ45
Expand Down

0 comments on commit 7704f63

Please sign in to comment.