From 42b65747c8e46308519f61915f45429cfccc7cbb Mon Sep 17 00:00:00 2001 From: junchao Date: Wed, 9 Sep 2020 10:25:20 +0800 Subject: [PATCH] Fix issue: fan status should not be True when fan is absent --- sonic-thermalctld/scripts/thermalctld | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sonic-thermalctld/scripts/thermalctld b/sonic-thermalctld/scripts/thermalctld index d70c9c69d..0e2797f89 100644 --- a/sonic-thermalctld/scripts/thermalctld +++ b/sonic-thermalctld/scripts/thermalctld @@ -311,12 +311,15 @@ class FanUpdater(logger.Logger): if not is_psu_fan: self._set_fan_led(fan_drawer, fan, fan_name, fan_status) + if fan_fault_status != NOT_AVAILABLE: + fan_fault_status = fan_status.is_ok() + fvs = swsscommon.FieldValuePairs( [('presence', str(presence)), ('drawer_name', drawer_name), ('model', str(try_get(fan.get_model))), ('serial', str(try_get(fan.get_serial))), - ('status', str(fan_fault_status and not(fan_status.under_speed or fan_status.over_speed))), + ('status', str(fan_fault_status)), ('direction', str(fan_direction)), ('speed', str(speed)), ('speed_tolerance', str(speed_tolerance)),