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/pcie.hpp b/redfish-core/lib/pcie.hpp
index 7ddbaa0..4068bac 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -271,8 +271,8 @@
messages::internalError(asyncResp->res);
return;
}
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, object.begin()->first, pcieDeviceSlot,
+ dbus::utility::getAllProperties(
+ object.begin()->first, pcieDeviceSlot,
"xyz.openbmc_project.Inventory.Item.PCIeSlot",
[asyncResp](
const boost::system::error_code& ec2,
@@ -298,8 +298,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getProperty<bool>(
+ service, pcieDevicePath,
"xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
[asyncResp](const boost::system::error_code& ec, const bool value) {
if (ec)
@@ -325,9 +325,9 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getProperty<bool>(
- *crow::connections::systemBus, service, pcieDevicePath,
- "xyz.openbmc_project.Inventory.Item", "Present",
+ dbus::utility::getProperty<bool>(
+ service, pcieDevicePath, "xyz.openbmc_project.Inventory.Item",
+ "Present",
[asyncResp](const boost::system::error_code& ec, bool value) {
if (ec)
{
@@ -351,8 +351,8 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& pcieDevicePath, const std::string& service)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getAllProperties(
+ service, pcieDevicePath,
"xyz.openbmc_project.Inventory.Decorator.Asset",
[pcieDevicePath, asyncResp{asyncResp}](
const boost::system::error_code& ec,
@@ -514,8 +514,8 @@
const std::function<void(
const dbus::utility::DBusPropertiesMap& pcieDevProperties)>&& callback)
{
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, service, pcieDevicePath,
+ dbus::utility::getAllProperties(
+ service, pcieDevicePath,
"xyz.openbmc_project.Inventory.Item.PCIeDevice",
[asyncResp,
callback](const boost::system::error_code& ec,