Skip to content

Commit a6c0071

Browse files
[thermalctld] Fix issue: fan status should not be True when fan is absent (sonic-net#92)
If fan is not present, keep fan status value as "N/A".
1 parent 0969202 commit a6c0071

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sonic-thermalctld/scripts/thermalctld

+4-1
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,15 @@ class FanUpdater(logger.Logger):
311311
if not is_psu_fan:
312312
self._set_fan_led(fan_drawer, fan, fan_name, fan_status)
313313

314+
if fan_fault_status != NOT_AVAILABLE:
315+
fan_fault_status = fan_status.is_ok()
316+
314317
fvs = swsscommon.FieldValuePairs(
315318
[('presence', str(presence)),
316319
('drawer_name', drawer_name),
317320
('model', str(try_get(fan.get_model))),
318321
('serial', str(try_get(fan.get_serial))),
319-
('status', str(fan_fault_status and not(fan_status.under_speed or fan_status.over_speed))),
322+
('status', str(fan_fault_status)),
320323
('direction', str(fan_direction)),
321324
('speed', str(speed)),
322325
('speed_tolerance', str(speed_tolerance)),

0 commit comments

Comments
 (0)