summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redfish-core/lib/managers.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 19c43f1948..55c3949cae 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1552,6 +1552,7 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
std::string iface;
if (!createNewObject)
{
+ bool findInterface = false;
for (const auto& interface : pathItr->second)
{
if (interface.first == pidConfigurationIface)
@@ -1560,7 +1561,8 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
type == "FanControllers")
{
iface = pidConfigurationIface;
- createNewObject = true;
+ findInterface = true;
+ break;
}
}
else if (interface.first == pidZoneConfigurationIface)
@@ -1568,7 +1570,8 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
if (type == "FanZones")
{
iface = pidConfigurationIface;
- createNewObject = true;
+ findInterface = true;
+ break;
}
}
else if (interface.first == stepwiseConfigurationIface)
@@ -1576,10 +1579,17 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
if (type == "StepwiseControllers")
{
iface = stepwiseConfigurationIface;
- createNewObject = true;
+ findInterface = true;
+ break;
}
}
}
+
+ // create new object if interface not found
+ if (!findInterface)
+ {
+ createNewObject = true;
+ }
}
if (createNewObject && it.value() == nullptr)