From f7afb17bf0a84101b26474bbd4dfc8f3aa3eb3f7 Mon Sep 17 00:00:00 2001 From: Alexander Hansen Date: Thu, 27 Apr 2023 14:34:08 +0200 Subject: bugfix: find existing powersupply for power sensor Fix lookup for existing powersupplies when building json. (dbus: '_' , json: ' ') Tested: manually with 2 Supermicro Power Supplies. Change-Id: Iecd14c0b9860a12c64b004c99cb6a7fb1dd0328a Signed-off-by: Alexander Hansen --- redfish-core/lib/sensors.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index ef3354d980..0772da559f 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -2185,7 +2185,8 @@ inline nlohmann::json& getPowerSupply(nlohmann::json& powerSupplyArray, // Check if matching PowerSupply object already exists in JSON array for (nlohmann::json& powerSupply : powerSupplyArray) { - if (powerSupply["Name"] == inventoryItem.name) + if (powerSupply["Name"] == + boost::replace_all_copy(inventoryItem.name, "_", " ")) { return powerSupply; } -- cgit v1.2.3