Add logging for Fan Presence / Redundancy
Add logging and fix bug with shared_ptr usage. We
now use a std::optional * to the shared redundancy
object, so that it can 1. point to object / null and 2.
exist in config or not.
Tested: cat /var/log/redfish to see logs made by removing
and adding fans, and using sensor override to change
redundancy.
Change-Id: Ic4b319cf7484cbbd7ce7dbdf7556f48bebe11cb0
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index 36556cf..a15da17 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -247,7 +247,7 @@
bool checkThresholds(Sensor* sensor)
{
- bool status = false;
+ bool status = true;
std::vector<std::pair<Threshold, bool>> changes =
checkThresholds(sensor, sensor->value);
for (const auto& [threshold, asserted] : changes)
@@ -256,7 +256,7 @@
asserted);
if (threshold.level == thresholds::Level::CRITICAL && asserted)
{
- status = true;
+ status = false;
}
}