diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py index 94e18a2e00..a682061d12 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py @@ -85,7 +85,7 @@ class MinCoolingLevelChangeCondition(ThermalPolicyConditionBase): trust_state = Thermal.check_module_temperature_trustable() temperature = Thermal.get_min_amb_temperature() - temperature = temperature / 1000 + temperature = int(temperature / 1000) change_cooling_level = False if trust_state != MinCoolingLevelChangeCondition.trust_state: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py index 87fac359b2..4d69a39c58 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py @@ -482,7 +482,7 @@ def test_dynamic_minimum_policy(thermal_manager): condition = policy.conditions[MinCoolingLevelChangeCondition] action = policy.actions[ChangeMinCoolingLevelAction] Thermal.check_module_temperature_trustable = MagicMock(return_value='trust') - Thermal.get_min_amb_temperature = MagicMock(return_value=35000) + Thermal.get_min_amb_temperature = MagicMock(return_value=35001) assert condition.is_match(None) assert MinCoolingLevelChangeCondition.trust_state == 'trust' assert MinCoolingLevelChangeCondition.temperature == 35 @@ -492,7 +492,7 @@ def test_dynamic_minimum_policy(thermal_manager): assert condition.is_match(None) assert MinCoolingLevelChangeCondition.trust_state == 'untrust' - Thermal.get_min_amb_temperature = MagicMock(return_value=25000) + Thermal.get_min_amb_temperature = MagicMock(return_value=25999) assert condition.is_match(None) assert MinCoolingLevelChangeCondition.temperature == 25