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/health.hpp b/redfish-core/lib/health.hpp
index ef858a1..c5249f2 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -212,7 +212,9 @@
void getAllStatusAssociations()
{
std::shared_ptr<HealthPopulate> self = shared_from_this();
- crow::connections::systemBus->async_method_call(
+ sdbusplus::message::object_path path("/");
+ dbus::utility::getManagedObjects(
+ "xyz.openbmc_project.ObjectMapper", path,
[self](const boost::system::error_code& ec,
const dbus::utility::ManagedObjectType& resp) {
if (ec)
@@ -230,9 +232,7 @@
}
it = self->statuses.erase(it);
}
- },
- "xyz.openbmc_project.ObjectMapper", "/",
- "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
+ });
}
std::shared_ptr<bmcweb::AsyncResp> asyncResp;