From a6c00714374dc0953632c4582240e4b5b44d9cce Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 16 Sep 2020 01:52:09 +0800 Subject: [PATCH] [thermalctld] Fix issue: fan status should not be True when fan is absent (#92) If fan is not present, keep fan status value as "N/A". --- 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 d70c9c69d80f..0e2797f89d29 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)),