Skip to content

Commit cf6f31b

Browse files
Junchao-Mellanoxmssonicbld
authored andcommitted
[Mellanox] Remove TODO comments which are no longer needed (#13023)
- Why I did it Remove TODO comments which are no longer needed - How I did it Remove TODO comments which are no longer needed - How to verify it Only comment change
1 parent 9680479 commit cf6f31b

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/module.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_position_in_parent(self):
9393
def is_replaceable(self):
9494
return True
9595

96-
def get_oper_status(self): # TODO: read from DB?
96+
def get_oper_status(self):
9797
if utils.read_int_from_file('/run/hw-management/system/lc{}_active'.format(self.slot_id)) == 1:
9898
return ModuleBase.MODULE_STATUS_ONLINE
9999
elif utils.read_int_from_file('/run/hw-management/system/lc{}_present'.format(self.slot_id)) == 1:
@@ -105,7 +105,7 @@ def get_oper_status(self): # TODO: read from DB?
105105

106106
def _check_state(self):
107107
"""Check Module status change:
108-
1. If status sysfs file value has been changed TODO: read from DB?
108+
1. If status sysfs file value has been changed
109109
2. If sequence NO has been changed which means line card has been removed and inserted again.
110110
"""
111111
seq_no = self._get_seq_no()
@@ -140,7 +140,7 @@ def initialize_thermals(self):
140140
self._check_state()
141141
if self.current_state == Module.STATE_ACTIVATED and not self._thermal_list:
142142
from .thermal import initialize_linecard_thermals
143-
self._thermal_list = initialize_linecard_thermals(self.get_name(), self.slot_id) # TODO: add presence_cb?
143+
self._thermal_list = initialize_linecard_thermals(self.get_name(), self.slot_id)
144144

145145
def get_num_thermals(self):
146146
"""
@@ -192,7 +192,7 @@ def initialize_single_sfp(self, index):
192192
if index < sfp_count:
193193
if not self._sfp_list:
194194
self._sfp_list = [None] * sfp_count
195-
195+
196196
if not self._sfp_list[index]:
197197
self._sfp_list[index] = self._create_sfp_object(index)
198198
self.sfp_initialized_count += 1
@@ -220,7 +220,7 @@ def get_num_sfps(self):
220220
"""
221221
if self.sfp_count == 0:
222222
self.sfp_count = DeviceDataManager.get_linecard_sfp_count(self.slot_id)
223-
return self.sfp_count
223+
return self.sfp_count
224224

225225
def get_all_sfps(self):
226226
"""

platform/mellanox/mlnx-platform-api/sonic_platform/psu.py

+14-16
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def get_voltage(self):
8484
Retrieves current PSU voltage output
8585
8686
Returns:
87-
A float number, the output voltage in volts,
88-
e.g. 12.1
87+
A float number, the output voltage in volts,
88+
e.g. 12.1
8989
"""
9090
return None
9191

@@ -143,7 +143,7 @@ def get_power_available_status(self):
143143
Gets the power available status
144144
145145
Returns:
146-
True if power is present and power on.
146+
True if power is present and power on.
147147
False and "absence of PSU" if power is not present.
148148
False and "absence of power" if power is present but not power on.
149149
"""
@@ -176,7 +176,7 @@ def get_temperature(self):
176176
177177
Returns:
178178
A float number of current temperature in Celsius up to nearest thousandth
179-
of one degree Celsius, e.g. 30.125
179+
of one degree Celsius, e.g. 30.125
180180
"""
181181
return None
182182

@@ -195,8 +195,8 @@ def get_input_voltage(self):
195195
Retrieves current PSU voltage input
196196
197197
Returns:
198-
A float number, the input voltage in volts,
199-
e.g. 12.1
198+
A float number, the input voltage in volts,
199+
e.g. 12.1
200200
"""
201201
return None
202202

@@ -264,7 +264,7 @@ def psu_voltage(self):
264264
psu_voltage_out = os.path.join(PSU_PATH, "power/psu{}_volt".format(self.index))
265265
if os.path.exists(psu_voltage_out):
266266
self._psu_voltage = psu_voltage_out
267-
267+
268268
return self._psu_voltage
269269

270270
@property
@@ -336,12 +336,10 @@ def get_voltage(self):
336336
Retrieves current PSU voltage output
337337
338338
Returns:
339-
A float number, the output voltage in volts,
340-
e.g. 12.1
339+
A float number, the output voltage in volts,
340+
e.g. 12.1
341341
"""
342342
if self.get_powergood_status() and self.psu_voltage:
343-
# TODO: should we put log_func=None here? If not do this, when a PSU is back to power, some PSU related
344-
# sysfs may not ready, read_int_from_file would encounter exception and log an error.
345343
voltage = utils.read_int_from_file(self.psu_voltage, log_func=logger.log_info)
346344
return float(voltage) / 1000
347345
return None
@@ -405,7 +403,7 @@ def get_temperature(self):
405403
406404
Returns:
407405
A float number of current temperature in Celsius up to nearest thousandth
408-
of one degree Celsius, e.g. 30.125
406+
of one degree Celsius, e.g. 30.125
409407
"""
410408
if self.get_powergood_status():
411409
temp = utils.read_int_from_file(self.psu_temp, log_func=logger.log_info)
@@ -492,8 +490,8 @@ def get_input_voltage(self):
492490
Retrieves current PSU voltage input
493491
494492
Returns:
495-
A float number, the input voltage in volts,
496-
e.g. 12.1
493+
A float number, the input voltage in volts,
494+
e.g. 12.1
497495
"""
498496
if self.get_powergood_status():
499497
voltage = utils.read_int_from_file(self.psu_voltage_in, log_func=logger.log_info)
@@ -563,13 +561,13 @@ def get_psu_power_critical_threshold(self):
563561

564562

565563
class InvalidPsuVolWA:
566-
"""This class is created as a workaround for a known hardware issue that the PSU voltage threshold could be a
564+
"""This class is created as a workaround for a known hardware issue that the PSU voltage threshold could be a
567565
invalid value 127998. Once we read a voltage threshold value equal to 127998, we should do following:
568566
1. Check the PSU vendor, it should be Delta
569567
2. Generate a temp sensor configuration file which contains a few set commands. Those set commands are the WA provided by low level team.
570568
3. Call "sensors -s -c <tmp_conf_file>"
571569
4. Wait for it to take effect
572-
570+
573571
This issue is found on 3700, 3700c, 3800, 4600c
574572
"""
575573

0 commit comments

Comments
 (0)