Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of
generated code, and more importantly, gives us a place where we can log
the requests and responses to help with debugging.
Tested: Redfish service validator passes.
Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index e670de7..adcb788 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -291,9 +291,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&
@@ -346,9 +345,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp,
path](const boost::system::error_code& ec, const bool isPresent) {
// this interface isn't necessary, only check it if
@@ -370,9 +368,8 @@
const std::string& connectionName,
const std::string& path)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.State.Drive", "Rebuilding",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.State.Drive", "Rebuilding",
[asyncResp](const boost::system::error_code& ec, const bool updating) {
// this interface isn't necessary, only check it
// if we get a good return
@@ -443,9 +440,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& connectionName, const std::string& path)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item.Drive",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item.Drive",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&
@@ -1036,9 +1032,8 @@
asyncResp->res.jsonValue["Id"] = controllerId;
asyncResp->res.jsonValue["Status"]["State"] = resource::State::Enabled;
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present",
[asyncResp](const boost::system::error_code& ec, bool isPresent) {
// this interface isn't necessary, only check it
// if we get a good return
@@ -1054,9 +1049,8 @@
}
});
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, connectionName, path,
- "xyz.openbmc_project.Inventory.Decorator.Asset",
+ dbus::utility::getAllProperties(
+ connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset",
[asyncResp](const boost::system::error_code& ec,
const std::vector<
std::pair<std::string, dbus::utility::DbusVariantType>>&