From e119b69ef305d8ae5e3989e63644a55f4ebb3126 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 13 Dec 2022 19:54:49 +0800 Subject: [PATCH] Remove TODO comments which are no longer needed (#325) Description Remove TODO comments which are no longer needed Motivation and Context Remove TODO comments which are no longer needed How Has This Been Tested? Only comment change --- sonic-thermalctld/scripts/thermalctld | 12 +++++------- sonic-xcvrd/tests/test_xcvrd.py | 3 --- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sonic-thermalctld/scripts/thermalctld b/sonic-thermalctld/scripts/thermalctld index 09b573c2899d..806bf5413d86 100644 --- a/sonic-thermalctld/scripts/thermalctld +++ b/sonic-thermalctld/scripts/thermalctld @@ -360,8 +360,6 @@ class FanUpdater(logger.Logger): format(fan_name, speed_target, speed, speed_tolerance) ) - # TODO: handle invalid fan direction - # We don't set PSU led here, PSU led will be handled in psud if set_led: if not is_psu_fan: @@ -401,8 +399,8 @@ class FanUpdater(logger.Logger): fan_drawer.set_status_led(led_color) except NotImplementedError as e: self.log_warning('Failed to set status LED for fan {}, set_status_led not implemented'.format(fan_name)) - - # Set led_initialized to True even if there is NotImplementedError as it is not neccessary to + + # Set led_initialized to True even if there is NotImplementedError as it is not neccessary to # print the warning log again and again. But if there is other exception, we could not # reach this line, and it will retry setting led color in the next run. fan_status.led_initialized = True @@ -613,7 +611,7 @@ class TemperatureUpdater(logger.Logger): available_thermals = set() for module_index, module in enumerate(self.chassis.get_all_modules()): module_name = try_get(module.get_name, 'Module {}'.format(module_index + 1)) - + for thermal_index, thermal in enumerate(module.get_all_thermals()): if self.task_stopping_event.is_set(): return @@ -639,12 +637,12 @@ class TemperatureUpdater(logger.Logger): available_thermals.add((thermal, psu_name, thermal_index)) self._refresh_temperature_status(psu_name, thermal, thermal_index) - + thermals_to_remove = self.module_thermals - available_thermals self.module_thermals = available_thermals for thermal, parent_name, thermal_index in thermals_to_remove: self._remove_thermal_from_db(thermal, parent_name, thermal_index) - + self.log_debug("End temperature updating") def _refresh_temperature_status(self, parent_name, thermal, thermal_index): diff --git a/sonic-xcvrd/tests/test_xcvrd.py b/sonic-xcvrd/tests/test_xcvrd.py index 0e57407cbce2..09cf0111abba 100644 --- a/sonic-xcvrd/tests/test_xcvrd.py +++ b/sonic-xcvrd/tests/test_xcvrd.py @@ -491,7 +491,6 @@ def test_DaemonXcvrd_run(self, mock_task_stop1, mock_task_stop2, mock_task_run1, xcvrd = DaemonXcvrd(SYSLOG_IDENTIFIER) xcvrd.stop_event.wait = MagicMock() xcvrd.run() - # TODO: more check assert mock_task_stop1.call_count == 1 assert mock_task_stop2.call_count == 1 assert mock_task_run1.call_count == 1 @@ -1317,8 +1316,6 @@ def test_DaemonXcvrd_init_deinit(self): xcvrd = DaemonXcvrd(SYSLOG_IDENTIFIER) xcvrd.init() xcvrd.deinit() - # TODO: fow now we only simply call xcvrd.init/deinit without any further check, it only makes sure that - # xcvrd.init/deinit will not raise unexpected exception. In future, probably more check will be added def wait_until(total_wait_time, interval, call_back, *args, **kwargs):