Skip to content

Commit 04014b6

Browse files
wangzhuijleveque
wangzhui
authored andcommitted
[sonic_sfp] Fix global name about sfp module is not defined (#53)
Signed-off-by: wangzhui <[email protected]>
1 parent 0caf265 commit 04014b6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

sonic_platform_base/sonic_sfp/sfputilbase.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,19 @@
8888
SFP_VOLT_WIDTH = 2
8989
SFP_CHANNL_MON_OFFSET = 100
9090
SFP_CHANNL_MON_WIDTH = 6
91+
SFP_MODULE_THRESHOLD_OFFSET = 0
92+
SFP_MODULE_THRESHOLD_WIDTH = 56
9193

92-
qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)',
94+
95+
qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)',
9396
'Length OM2(m)', 'Length OM1(m)',
9497
'Length Cable Assembly(m)')
9598

9699
sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)',
97100
'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)',
98101
'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)')
99102

100-
sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode',
103+
sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode',
101104
'ESCONComplianceCodes', 'SONETComplianceCodes',
102105
'EthernetComplianceCodes','FibreChannelLinkLength',
103106
'FibreChannelTechnology', 'SFP+CableTechnology',
@@ -883,7 +886,7 @@ def get_transceiver_info_dict(self, port_num):
883886
if key in sfp_interface_bulk_data['data']['Specification compliance']['value']:
884887
compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value']
885888
transceiver_info_dict['specification_compliance'] = str(compliance_code_dict)
886-
889+
887890
transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value'])
888891
else:
889892
for key in sfp_cable_length_tup:
@@ -897,7 +900,7 @@ def get_transceiver_info_dict(self, port_num):
897900
transceiver_info_dict['specification_compliance'] = str(compliance_code_dict)
898901

899902
transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value'])
900-
903+
901904
return transceiver_info_dict
902905

903906
def get_transceiver_dom_info_dict(self, port_num):
@@ -1256,12 +1259,12 @@ def reset(self, port_num):
12561259
@abc.abstractmethod
12571260
def get_transceiver_change_event(self, timeout=0):
12581261
"""
1259-
:param timeout in milliseconds. The method is a blocking call. When timeout is
1262+
:param timeout in milliseconds. The method is a blocking call. When timeout is
12601263
zero, it only returns when there is change event, i.e., transceiver plug-in/out
12611264
event. When timeout is non-zero, the function can also return when the timer expires.
12621265
When timer expires, the return status is True and events is empty.
12631266
:returns: (status, events)
1264-
:status: Boolean, True if call successful and no system level event/error occurred,
1267+
:status: Boolean, True if call successful and no system level event/error occurred,
12651268
False if call not success or system level event/error occurred.
12661269
:events: dictionary for physical port index and the SFP status,
12671270
status='1' represent plug in, '0' represent plug out like {'0': '1', '31':'0'}

0 commit comments

Comments
 (0)