diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-02-06 19:59:12 +0530 |
---|---|---|
committer | Ratan Gupta <ratagupt@in.ibm.com> | 2017-02-14 23:21:49 +0530 |
commit | 0fc20ed1a596cec22b3a5f5f5a44ee288fb7dd24 (patch) | |
tree | 25027d212c0926888951fe89004f7b32243c228f /writefrudata.cpp | |
parent | 6eed4032cb2b08a8b9d41329fc3553a65269cbde (diff) | |
download | ipmi-fru-parser-0fc20ed1a596cec22b3a5f5f5a44ee288fb7dd24.tar.gz ipmi-fru-parser-0fc20ed1a596cec22b3a5f5f5a44ee288fb7dd24.zip |
inventory : adhere to change in PIM Notify()
Change-Id: I83efc8ad799aaa879525d84b97779d5b98f168c4
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'writefrudata.cpp')
-rw-r--r-- | writefrudata.cpp | 49 |
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; } |