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 <alexander.hansen@9elements.com>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index ef3354d..0772da5 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2185,7 +2185,8 @@
// 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;
}