Refactor getAssociationEndPoints method
Since the getAssociationEndPoints method has been implemented in
dbus_utility and this commit is to integrate all the places where the
endpoints attribute is obtained, and use the method in dbus_utility
uniformly.
Tested:
1. Redfish Validator Passed
2. For all the endpoints we changed, we got the same result as before
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I91a5e80de5bc3b5712c2d5b81f2f8b982d1c884e
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 4701af4..dd77195 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -250,12 +250,10 @@
auto health = std::make_shared<HealthPopulate>(asyncResp);
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus,
- "xyz.openbmc_project.ObjectMapper", path + "/all_sensors",
- "xyz.openbmc_project.Association", "endpoints",
+ dbus::utility::getAssociationEndPoints(
+ path + "/all_sensors",
[health](const boost::system::error_code& ec2,
- const std::vector<std::string>& resp) {
+ const dbus::utility::MapperEndPoints& resp) {
if (ec2)
{
return; // no sensors = no failures
@@ -290,12 +288,11 @@
crow::utility::urlFromPieces("redfish", "v1", "Systems",
"system", "PCIeDevices");
- sdbusplus::asio::getProperty<std::vector<std::string>>(
- *crow::connections::systemBus,
- "xyz.openbmc_project.ObjectMapper", path + "/drive",
- "xyz.openbmc_project.Association", "endpoints",
- [asyncResp, chassisId](const boost::system::error_code& ec3,
- const std::vector<std::string>& resp) {
+ dbus::utility::getAssociationEndPoints(
+ path + "/drive",
+ [asyncResp,
+ chassisId](const boost::system::error_code& ec3,
+ const dbus::utility::MapperEndPoints& resp) {
if (ec3 || resp.empty())
{
return; // no drives = no failures