Skip to content

Commit bea68f4

Browse files
pphucharjleveque
authored andcommitted
[sfputilbase] Fix xcvr and sfpshow crash with OSFP (sonic-net#63)
* fix xcvr crash when read OSFP DOM threshold * fix sfpshow crash when trying to decodes OSFP's specification_compliance
1 parent cc2dac5 commit bea68f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sonic_platform_base/sonic_sfp/sfputilbase.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def get_transceiver_info_dict(self, port_num):
777777
transceiver_info_dict['ext_rateselect_compliance'] = 'N/A'
778778
transceiver_info_dict['cable_type'] = 'N/A'
779779
transceiver_info_dict['cable_length'] = 'N/A'
780-
transceiver_info_dict['specification_compliance'] = 'N/A'
780+
transceiver_info_dict['specification_compliance'] = '{}'
781781
transceiver_info_dict['nominal_bit_rate'] = 'N/A'
782782

783783
else:
@@ -1103,7 +1103,11 @@ def get_transceiver_dom_threshold_info_dict(self, port_num):
11031103
]
11041104
transceiver_dom_threshold_info_dict = dict.fromkeys(dom_info_dict_keys, 'N/A')
11051105

1106-
if port_num in self.qsfp_ports:
1106+
if port_num in self.osfp_ports:
1107+
# Below part is added to avoid fail xcvrd, shall be implemented later
1108+
return transceiver_dom_threshold_info_dict
1109+
1110+
elif port_num in self.qsfp_ports:
11071111
file_path = self._get_port_eeprom_path(port_num, self.IDENTITY_EEPROM_ADDR)
11081112
if not self._sfp_eeprom_present(file_path, 0):
11091113
return None

0 commit comments

Comments
 (0)