monitor: Don't create errors for missing sensors
Don't start the error timer (so no errors would be created) in the cases
where the tach sensor is being made nonfunctional because its value
can't be found on D-Bus, as that error indicates a problem with the fan
itself, which is fine.
Also don't check any power off actions in this case either so a running
system isn't turned off.
If no sensors at all are on D-Bus, that is already caught during a power
on.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If5cd6d1d444be11b9666500db89b4bb82d7b282a
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 660a732..ec89d5b 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -238,7 +238,7 @@
}
}
-void TachSensor::setFunctional(bool functional)
+void TachSensor::setFunctional(bool functional, bool skipErrorTimer)
{
_functional = functional;
updateInventory(_functional);
@@ -250,7 +250,7 @@
if (!_functional)
{
- if (_fan.present())
+ if (_fan.present() && !skipErrorTimer)
{
_errorTimer->restartOnce(std::chrono::seconds(*_errorDelay));
}