diff options
author | George Liu <liuxiwei@inspur.com> | 2022-12-07 11:03:22 +0300 |
---|---|---|
committer | George Liu <liuxiwei@inspur.com> | 2023-01-11 04:10:26 +0300 |
commit | 7a1dbc4803bf78bfc0c574e6676b3c5def4cdae3 (patch) | |
tree | 9d4713a0125046d112ce3eae7053364ddb2c1d26 /include/google | |
parent | 1f2a40ce3223e024d510f2e3b32fbc7e08012728 (diff) | |
download | bmcweb-7a1dbc4803bf78bfc0c574e6676b3c5def4cdae3.tar.xz |
Refactor GetSubTreePaths method
Since the GetSubTreePaths method has been implemented in dbus_utility
and this commit is to integrate all the places where the
GetSubTreePaths method is called, and use the method in dbus_utility
uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to
build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
Diffstat (limited to 'include/google')
-rw-r--r-- | include/google/google_service_root.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp index d802d00b1f..f14cffe20b 100644 --- a/include/google/google_service_root.hpp +++ b/include/google/google_service_root.hpp @@ -9,6 +9,8 @@ #include <utils/hex_utils.hpp> #include <utils/json_utils.hpp> +#include <array> +#include <string_view> #include <vector> namespace crow @@ -37,9 +39,11 @@ inline void handleRootOfTrustCollectionGet( asyncResp->res.jsonValue["@odata.id"] = "/google/v1/RootOfTrustCollection"; asyncResp->res.jsonValue["@odata.type"] = "#RootOfTrustCollection.RootOfTrustCollection"; + const std::array<std::string_view, 1> interfaces{ + "xyz.openbmc_project.Control.Hoth"}; redfish::collection_util::getCollectionMembers( asyncResp, boost::urls::url("/google/v1/RootOfTrustCollection"), - {"xyz.openbmc_project.Control.Hoth"}, "/xyz/openbmc_project"); + interfaces, "/xyz/openbmc_project"); } // Helper struct to identify a resolved D-Bus object interface @@ -94,7 +98,7 @@ inline void resolveRoT(const std::string& command, ResolvedEntityHandler&& entityHandler) { - std::array<std::string, 1> hothIfaces = { + constexpr std::array<std::string_view, 1> hothIfaces = { "xyz.openbmc_project.Control.Hoth"}; crow::connections::systemBus->async_method_call( [command, asyncResp, rotId, |