summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-03-08 03:48:38 +0300
committerEd Tanous <ed@tanous.net>2022-09-02 03:57:12 +0300
commitea2b670d306d85d6975b6174024985491af04a89 (patch)
tree160b4d880692e2a216249a7660b36eb53f40104d
parent3fe4d5cca464ff7696236fe42acf64637e9126d9 (diff)
downloadbmcweb-ea2b670d306d85d6975b6174024985491af04a89.tar.xz
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 <edtanous@google.com> Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I89d36f1b0b3699b6bf07a17af029e5a2504c85de
-rw-r--r--redfish-core/lib/managers.hpp55
1 files 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<SetPIDValues>
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)
{