Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in
dbus_utility and this commit is to integrate all the places where the
GetManagedObjects method is obtained, and use the method in
dbus_utility uniformly.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ic13f2bef7b30f805cd3444a75d7df17b031f2eb0
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index a2c49a6..2d52cd7 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -225,7 +225,9 @@
{
BMCWEB_LOG_DEBUG << "Get available system cpu resources by service.";
- crow::connections::systemBus->async_method_call(
+ sdbusplus::message::object_path path("/xyz/openbmc_project/inventory");
+ dbus::utility::getManagedObjects(
+ service, path,
[cpuId, service, objPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& dbusData) {
@@ -288,9 +290,7 @@
asyncResp->res.jsonValue["TotalCores"] = totalCores;
}
return;
- },
- service, "/xyz/openbmc_project/inventory",
- "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
+ });
}
/**