Skip to content

Commit c21507e

Browse files
authored
[sfp_base] Raise exceptions (previously was incorrectly returning them) (sonic-net#61)
1 parent 087593e commit c21507e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

sonic_platform_base/sfp_base.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_transceiver_info(self):
4141
vendor_oui |1*255VCHAR |vendor OUI
4242
========================================================================
4343
"""
44-
return NotImplementedError
44+
raise NotImplementedError
4545

4646
def get_transceiver_bulk_status(self):
4747
"""
@@ -69,7 +69,7 @@ def get_transceiver_bulk_status(self):
6969
| |for example, tx2power stands for tx power of channel 2.
7070
========================================================================
7171
"""
72-
return NotImplementedError
72+
raise NotImplementedError
7373

7474
def get_transceiver_threshold_info(self):
7575
"""
@@ -102,7 +102,7 @@ def get_transceiver_threshold_info(self):
102102
txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA.
103103
========================================================================
104104
"""
105-
return NotImplementedError
105+
raise NotImplementedError
106106

107107
def get_reset_status(self):
108108
"""
@@ -111,7 +111,7 @@ def get_reset_status(self):
111111
Returns:
112112
A Boolean, True if reset enabled, False if disabled
113113
"""
114-
return NotImplementedError
114+
raise NotImplementedError
115115

116116
def get_rx_los(self):
117117
"""
@@ -121,7 +121,7 @@ def get_rx_los(self):
121121
A Boolean, True if SFP has RX LOS, False if not.
122122
Note : RX LOS status is latched until a call to get_rx_los or a reset.
123123
"""
124-
return NotImplementedError
124+
raise NotImplementedError
125125

126126
def get_tx_fault(self):
127127
"""
@@ -131,7 +131,7 @@ def get_tx_fault(self):
131131
A Boolean, True if SFP has TX fault, False if not
132132
Note : TX fault status is lached until a call to get_tx_fault or a reset.
133133
"""
134-
return NotImplementedError
134+
raise NotImplementedError
135135

136136
def get_tx_disable(self):
137137
"""
@@ -140,7 +140,7 @@ def get_tx_disable(self):
140140
Returns:
141141
A Boolean, True if tx_disable is enabled, False if disabled
142142
"""
143-
return NotImplementedError
143+
raise NotImplementedError
144144

145145
def get_tx_disable_channel(self):
146146
"""
@@ -152,7 +152,7 @@ def get_tx_disable_channel(self):
152152
As an example, a returned value of 0x5 indicates that channel 0
153153
and channel 2 have been disabled.
154154
"""
155-
return NotImplementedError
155+
raise NotImplementedError
156156

157157
def get_lpmode(self):
158158
"""
@@ -161,7 +161,7 @@ def get_lpmode(self):
161161
Returns:
162162
A Boolean, True if lpmode is enabled, False if disabled
163163
"""
164-
return NotImplementedError
164+
raise NotImplementedError
165165

166166
def get_power_override(self):
167167
"""
@@ -170,7 +170,7 @@ def get_power_override(self):
170170
Returns:
171171
A Boolean, True if power-override is enabled, False if disabled
172172
"""
173-
return NotImplementedError
173+
raise NotImplementedError
174174

175175
def get_temperature(self):
176176
"""
@@ -179,7 +179,7 @@ def get_temperature(self):
179179
Returns:
180180
An integer number of current temperature in Celsius
181181
"""
182-
return NotImplementedError
182+
raise NotImplementedError
183183

184184

185185
def get_voltage(self):
@@ -189,7 +189,7 @@ def get_voltage(self):
189189
Returns:
190190
An integer number of supply voltage in mV
191191
"""
192-
return NotImplementedError
192+
raise NotImplementedError
193193

194194
def get_tx_bias(self):
195195
"""
@@ -200,7 +200,7 @@ def get_tx_bias(self):
200200
for channel 0 to channel 4.
201201
Ex. ['110.09', '111.12', '108.21', '112.09']
202202
"""
203-
return NotImplementedError
203+
raise NotImplementedError
204204

205205
def get_rx_power(self):
206206
"""
@@ -211,7 +211,7 @@ def get_rx_power(self):
211211
power in mW for channel 0 to channel 4.
212212
Ex. ['1.77', '1.71', '1.68', '1.70']
213213
"""
214-
return NotImplementedError
214+
raise NotImplementedError
215215

216216
def get_tx_power(self):
217217
"""
@@ -222,7 +222,7 @@ def get_tx_power(self):
222222
for channel 0 to channel 4.
223223
Ex. ['1.86', '1.86', '1.86', '1.86']
224224
"""
225-
return NotImplementedError
225+
raise NotImplementedError
226226

227227
def reset(self):
228228
"""
@@ -231,7 +231,7 @@ def reset(self):
231231
Returns:
232232
A boolean, True if successful, False if not
233233
"""
234-
return NotImplementedError
234+
raise NotImplementedError
235235

236236
def tx_disable(self, tx_disable):
237237
"""
@@ -244,7 +244,7 @@ def tx_disable(self, tx_disable):
244244
Returns:
245245
A boolean, True if tx_disable is set successfully, False if not
246246
"""
247-
return NotImplementedError
247+
raise NotImplementedError
248248

249249
def tx_disable_channel(self, channel, disable):
250250
"""
@@ -259,7 +259,7 @@ def tx_disable_channel(self, channel, disable):
259259
Returns:
260260
A boolean, True if successful, False if not
261261
"""
262-
return NotImplementedError
262+
raise NotImplementedError
263263

264264
def set_lpmode(self, lpmode):
265265
"""
@@ -272,7 +272,7 @@ def set_lpmode(self, lpmode):
272272
Returns:
273273
A boolean, True if lpmode is set successfully, False if not
274274
"""
275-
return NotImplementedError
275+
raise NotImplementedError
276276

277277
def set_power_override(self, power_override, power_set):
278278
"""
@@ -293,4 +293,4 @@ def set_power_override(self, power_override, power_set):
293293
A boolean, True if power-override and power_set are set successfully,
294294
False if not
295295
"""
296-
return NotImplementedError
296+
raise NotImplementedError

0 commit comments

Comments
 (0)