Skip to content

Commit

Permalink
Fix issue: port_type is referenced before initialized (#2323)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs authored Aug 20, 2022
1 parent 7704f63 commit e14f679
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utilities_common/platform_sfputil_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@ def is_rj45_port(port_name):
if not platform_porttab_mapping_read:
platform_sfputil_read_porttab_mappings()

port_type = None
try:
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
pass

return port_type == platform_sfp_base.SFP_PORT_TYPE_BIT_RJ45

Expand Down

0 comments on commit e14f679

Please sign in to comment.