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/managers.hpp b/redfish-core/lib/managers.hpp
index 82ee25f..2f21656 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1289,7 +1289,7 @@
const std::string& path = subtreeLocal[0].first;
const std::string& owner = subtreeLocal[0].second[0].first;
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
thermalModeIface,
[path, owner,
@@ -1487,7 +1487,7 @@
const std::string& path = subtree[0].first;
const std::string& owner = subtree[0].second[0].first;
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, owner, path,
thermalModeIface,
[self, path,
@@ -1777,8 +1777,8 @@
{
BMCWEB_LOG_DEBUG("Get BMC manager Location data.");
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, connectionName, path,
+ dbus::utility::getProperty<std::string>(
+ connectionName, path,
"xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
[asyncResp](const boost::system::error_code& ec,
const std::string& property) {
@@ -1801,10 +1801,9 @@
{
BMCWEB_LOG_DEBUG("Getting Manager Last Reset Time");
- sdbusplus::asio::getProperty<uint64_t>(
- *crow::connections::systemBus, "xyz.openbmc_project.State.BMC",
- "/xyz/openbmc_project/state/bmc0", "xyz.openbmc_project.State.BMC",
- "LastRebootTime",
+ dbus::utility::getProperty<uint64_t>(
+ "xyz.openbmc_project.State.BMC", "/xyz/openbmc_project/state/bmc0",
+ "xyz.openbmc_project.State.BMC", "LastRebootTime",
[asyncResp](const boost::system::error_code& ec,
const uint64_t lastResetTime) {
if (ec)
@@ -1988,8 +1987,8 @@
inline void
checkForQuiesced(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
{
- sdbusplus::asio::getProperty<std::string>(
- *crow::connections::systemBus, "org.freedesktop.systemd1",
+ dbus::utility::getProperty<std::string>(
+ "org.freedesktop.systemd1",
"/org/freedesktop/systemd1/unit/obmc-bmc-service-quiesce@0.target",
"org.freedesktop.systemd1.Unit", "ActiveState",
[asyncResp](const boost::system::error_code& ec,
@@ -2176,10 +2175,9 @@
chassiUrl;
});
- sdbusplus::asio::getProperty<double>(
- *crow::connections::systemBus, "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager",
- "Progress",
+ dbus::utility::getProperty<double>(
+ "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager", "Progress",
[asyncResp](const boost::system::error_code& ec, double val) {
if (ec)
{
@@ -2243,7 +2241,7 @@
if (interfaceName ==
"xyz.openbmc_project.Inventory.Decorator.Asset")
{
- sdbusplus::asio::getAllProperties(
+ dbus::utility::getAllProperties(
*crow::connections::systemBus, connectionName,
path,
"xyz.openbmc_project.Inventory.Decorator.Asset",