PSUEvent: Fix for duplicate event logs in redfish
Issue: Same events logged multiple times in Redfish event log.
Fix: Provided fix, not to log duplicate event logs in Redfish.
Tested:
Verified by removing 1 PSU.
GET: https://<BMC IP>/redfish/v1/Systems/system/LogServices/
EventLog/Entries
Duplicate event logs are not found in Redfish event log.
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I862a46e75b882e05606098c9e83a92cb29fc6dce
diff --git a/src/PSUEvent.cpp b/src/PSUEvent.cpp
index 08101de..beb5755 100644
--- a/src/PSUEvent.cpp
+++ b/src/PSUEvent.cpp
@@ -222,6 +222,7 @@
auto foundCombine = (*combineEvent).find(eventName);
if (foundCombine == (*combineEvent).end())
{
+ value = newValue;
return;
}
(*combineEvent).erase(eventName);
@@ -259,6 +260,12 @@
if (*assertState == false)
{
*assertState = true;
+ auto foundCombine = (*combineEvent).find(eventName);
+ if (foundCombine != (*combineEvent).end())
+ {
+ value = newValue;
+ return;
+ }
if (!assertMessage.empty())
{
// Fan Failed has two args