Fix OperationalStatus disappear problem
Fix the problem that after BMC reboot, there will be no OperationalStatus
path in PSUSensor.
Tested:
Reboot BMC, /xyz/openbmc_project/State/Decorator/PSUx_OperationalStatus should
show in PSUSensor D-Bus interface. And Power Unit Redundancy should work
correctly.
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>
Change-Id: I1750ba25c9d6ecbebeebc8447567581ba99266cf
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index d66e5be..400c514 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -149,6 +149,7 @@
// TODO may need only modify the ones that need to be changed.
sensors.clear();
+ combineEvents.clear();
for (const char* type : sensorTypes)
{
if (!getSensorConfiguration(type, dbusConnection, sensorConfigs,
@@ -433,6 +434,7 @@
}
// OperationalStatus event
+ combineEvents[*psuName + "OperationalStatus"] = nullptr;
combineEvents[*psuName + "OperationalStatus"] =
std::make_unique<PSUCombineEvent>(
objectServer, io, *psuName, eventPathList, "OperationalStatus");