summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--writefrudata.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/writefrudata.cpp b/writefrudata.cpp
index c5f2539..9a19e7d 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -481,34 +481,30 @@ int ipmi_update_inventory(fru_area_vec_t& area_vec)
std::cerr << e.what() << "\n";
return -1;
}
- auto notify = [&]()
- {
- return bus.new_method_call(
- service.c_str(),
- path.c_str(),
- intf.c_str(),
- "Notify");
- };
auto iter = frus.find(fruid);
if (iter == frus.end())
{
- std::cerr << "ERROR Unable to get the fru info for FRU=" << fruid << "\n";
+ std::cerr << "ERROR Unable to get the fru info for FRU="
+ << static_cast<int>(fruid) << "\n";
return -1;
}
auto& instanceList = iter->second;
if (instanceList.size() <= 0)
{
- std::cout << "Object List empty for this FRU=" << fruid << "\n";
+ std::cout << "Object List empty for this FRU="
+ << static_cast<int>(fruid) << "\n";
}
+
+ ObjectMap objects;
for (auto& instance : instanceList)
{
- InterfaceList interfaces;
+ InterfaceMap interfaces;
for (auto& interfaceList : instance.second)
{
- PropertiesList prop;//store all the properties
+ PropertyMap props;//store all the properties
for (auto& properties : interfaceList.second)
{
std::string section, property, value;
@@ -528,22 +524,27 @@ int ipmi_update_inventory(fru_area_vec_t& area_vec)
{
value = getFRUValue(section, property, fruData);
}
- prop.emplace(std::move(properties.first), std::move(value));
+ props.emplace(std::move(properties.first), std::move(value));
}
- interfaces.emplace(std::move(interfaceList.first), std::move(prop));
+ interfaces.emplace(std::move(interfaceList.first), std::move(props));
}
+
//Call the inventory manager
- sdbusplus::message::object_path relPath = instance.first;
+ sdbusplus::message::object_path path = instance.first;
+ objects.emplace(path,interfaces);
+ }
- auto m = notify();
- m.append(relPath);
- m.append(interfaces);
- auto inventoryMgrResponseMsg = bus.call(m);
- if (inventoryMgrResponseMsg.is_method_error())
- {
- std::cerr << "Error in notify call\n";
- return -1;
- }
+ auto pimMsg = bus.new_method_call(
+ service.c_str(),
+ path.c_str(),
+ intf.c_str(),
+ "Notify");
+ pimMsg.append(std::move(objects));
+ auto inventoryMgrResponseMsg = bus.call(pimMsg);
+ if (inventoryMgrResponseMsg.is_method_error())
+ {
+ std::cerr << "Error in notify call\n";
+ return -1;
}
return rc;
}
OpenPOWER on IntegriCloud