Skip to content

Commit 7704f63

Browse files
authored
Fix issue: exception in is_rj45_port in multi ASIC env (sonic-net#2313)
* Fix issue: exception in is_rj45_port in multi ASIC env Signed-off-by: Stephen Sun <[email protected]>
1 parent 6fc4f15 commit 7704f63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utilities_common/platform_sfputil_helper.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ def is_rj45_port(port_name):
131131
if not platform_porttab_mapping_read:
132132
platform_sfputil_read_porttab_mappings()
133133

134-
physical_port = logical_port_name_to_physical_port_list(port_name)[0]
135134
try:
136-
port_type = platform_chassis.get_port_or_cage_type(physical_port)
137-
except NotImplementedError as e:
135+
physical_port = logical_port_name_to_physical_port_list(port_name)
136+
if physical_port:
137+
port_type = platform_chassis.get_port_or_cage_type(physical_port[0])
138+
except Exception as e:
138139
port_type = None
139140

140141
return port_type == platform_sfp_base.SFP_PORT_TYPE_BIT_RJ45

0 commit comments

Comments
 (0)