From ea2b670d306d85d6975b6174024985491af04a89 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Mon, 7 Mar 2022 16:48:38 -0800 Subject: Fix regression in pid setting It looks like one of the patchset merge conflicts got rebased poorly (ie commented out). In the meantime, a number of these structures have gone from map->vector, so modify the algorithm to account for that. Tested: 1. Redfish validator - passed with this change. 2. Verified from Redfish by patching "StepwiseControllers" sensors. Signed-off-by: Ed Tanous Signed-off-by: Jayaprakash Mutyala Change-Id: I89d36f1b0b3699b6bf07a17af029e5a2504c85de --- redfish-core/lib/managers.hpp | 55 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index b8fe156bae..f934fd6f98 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -1530,38 +1530,37 @@ struct SetPIDValues : std::enable_shared_from_this BMCWEB_LOG_DEBUG << "Found = " << !createNewObject; std::string iface; - /* - if (type == "PidControllers" || type == "FanControllers") - { - iface = pidConfigurationIface; - if (!createNewObject && - pathItr->second.find(pidConfigurationIface) == - pathItr->second.end()) - { - createNewObject = true; - } - } - else if (type == "FanZones") + if (!createNewObject) { - iface = pidZoneConfigurationIface; - if (!createNewObject && - pathItr->second.find(pidZoneConfigurationIface) == - pathItr->second.end()) + for (const auto& interface : pathItr->second) { - - createNewObject = true; + if (interface.first == pidConfigurationIface) + { + if (type == "PidControllers" || + type == "FanControllers") + { + iface = pidConfigurationIface; + createNewObject = true; + } + } + else if (interface.first == pidZoneConfigurationIface) + { + if (type == "FanZones") + { + iface = pidConfigurationIface; + createNewObject = true; + } + } + else if (interface.first == stepwiseConfigurationIface) + { + if (type == "StepwiseControllers") + { + iface = stepwiseConfigurationIface; + createNewObject = true; + } + } } } - else if (type == "StepwiseControllers") - { - iface = stepwiseConfigurationIface; - if (!createNewObject && - pathItr->second.find(stepwiseConfigurationIface) == - pathItr->second.end()) - { - createNewObject = true; - } - }*/ if (createNewObject && it.value() == nullptr) { -- cgit v1.2.3