summaryrefslogtreecommitdiff
path: root/include/google
diff options
context:
space:
mode:
authorGeorge Liu <liuxiwei@inspur.com>2022-12-09 06:06:16 +0300
committerLakshmi Yadlapati <lakshmiy@us.ibm.com>2023-01-24 17:57:43 +0300
commite99073f55f30e2af2c36d7859513ea9464fa647d (patch)
treed3f8b9d0b697717e8c441a6c45f0f72330c21499 /include/google
parentc2e320079eeafbc952a6233e31e8a844bbede9ab (diff)
downloadbmcweb-e99073f55f30e2af2c36d7859513ea9464fa647d.tar.xz
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method in dbus_utility uniformly. Tested: Redfish Validator Passed Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: If3852b487d74e7cd8f123e0efffbd4affe92743c
Diffstat (limited to 'include/google')
-rw-r--r--include/google/google_service_root.hpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
index 7d48845714..fd8aad48b0 100644
--- a/include/google/google_service_root.hpp
+++ b/include/google/google_service_root.hpp
@@ -8,6 +8,7 @@
#include "utils/hex_utils.hpp"
#include "utils/json_utils.hpp"
+#include <boost/system/error_code.hpp>
#include <nlohmann/json.hpp>
#include <array>
@@ -98,22 +99,17 @@ inline void resolveRoT(const std::string& command,
const std::string& rotId,
ResolvedEntityHandler&& entityHandler)
{
-
constexpr std::array<std::string_view, 1> hothIfaces = {
"xyz.openbmc_project.Control.Hoth"};
- crow::connections::systemBus->async_method_call(
+ dbus::utility::getSubTree(
+ "/xyz/openbmc_project", 0, hothIfaces,
[command, asyncResp, rotId,
entityHandler{std::forward<ResolvedEntityHandler>(entityHandler)}](
- const boost::system::error_code ec,
+ const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreeResponse& subtree) {
hothGetSubtreeCallback(command, asyncResp, rotId, entityHandler, ec,
subtree);
- },
- "xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper", "GetSubTree",
- "/xyz/openbmc_project",
- /*depth=*/0, hothIfaces);
+ });
}
inline void populateRootOfTrustEntity(