diff options
author | Alexander Hansen <alexander.hansen@9elements.com> | 2023-04-27 15:34:08 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-05-04 22:06:36 +0300 |
commit | f7afb17bf0a84101b26474bbd4dfc8f3aa3eb3f7 (patch) | |
tree | 425d38fd5ac7f81cf73bbf7c3c857375b8b02820 | |
parent | 38e3d67d0bf36165126518894f9a5e7d3a3691de (diff) | |
download | bmcweb-f7afb17bf0a84101b26474bbd4dfc8f3aa3eb3f7.tar.xz |
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>
-rw-r--r-- | redfish-core/lib/sensors.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |