Skip to content

Commit

Permalink
[thermalctld] Fix issue: fan status should not be True when fan is ab…
Browse files Browse the repository at this point in the history
…sent (#92)

If fan is not present, keep fan status value as "N/A".
  • Loading branch information
Junchao-Mellanox authored Sep 15, 2020
1 parent 0969202 commit a6c0071
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sonic-thermalctld/scripts/thermalctld
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit a6c0071

Please sign in to comment.