diff options
author | George Liu <liuxiwei@inspur.com> | 2023-01-11 11:27:13 +0300 |
---|---|---|
committer | George Liu <liuxiwei@inspur.com> | 2023-01-19 03:27:03 +0300 |
commit | 2b73119c57d054d1a0d67b376ae5651fccfae5ba (patch) | |
tree | 9e7824d11af9084d59bf700250238bf7860142cd /redfish-core/lib/account_service.hpp | |
parent | 703f67418ae1915e49ac32d475de872da3ab2819 (diff) | |
download | bmcweb-2b73119c57d054d1a0d67b376ae5651fccfae5ba.tar.xz |
Add the GetObject method to dbus_utility
There are currently many files that use the GetObject method.
Since they are a general method, they are defined in the
dbus_utility.hpp file and refactors them.
Tested: Built bmcweb successfully and Validator passes.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: If2af77294389b023b611987252ee6149906fcd25
Diffstat (limited to 'redfish-core/lib/account_service.hpp')
-rw-r--r-- | redfish-core/lib/account_service.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index abf255eb00..9f99d184ab 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -29,8 +29,10 @@ #include <sdbusplus/asio/property.hpp> #include <sdbusplus/unpack_properties.hpp> +#include <array> #include <optional> #include <string> +#include <string_view> #include <vector> namespace redfish @@ -425,11 +427,12 @@ inline void getLDAPConfigData(const std::string& ldapType, CallbackFunc&& callback) { - const std::array<const char*, 2> interfaces = {ldapEnableInterface, - ldapConfigInterface}; + constexpr std::array<std::string_view, 2> interfaces = { + ldapEnableInterface, ldapConfigInterface}; - crow::connections::systemBus->async_method_call( - [callback, ldapType](const boost::system::error_code ec, + dbus::utility::getDbusObject( + ldapConfigObjectName, interfaces, + [callback, ldapType](const boost::system::error_code& ec, const dbus::utility::MapperGetObject& resp) { if (ec || resp.empty()) { @@ -580,9 +583,7 @@ inline void getLDAPConfigData(const std::string& ldapType, callback(true, confData, ldapType); }, service, ldapRootObject, dbusObjManagerIntf, "GetManagedObjects"); - }, - mapperBusName, mapperObjectPath, mapperIntf, "GetObject", - ldapConfigObjectName, interfaces); + }); } /** |