diff options
Diffstat (limited to 'redfish-core/lib/health.hpp')
-rw-r--r-- | redfish-core/lib/health.hpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp index 254f8e9203..c7f296029a 100644 --- a/redfish-core/lib/health.hpp +++ b/redfish-core/lib/health.hpp @@ -196,12 +196,12 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate> crow::connections::systemBus->async_method_call( [self](const boost::system::error_code ec, const dbus::utility::MapperGetSubTreePathsResponse& resp) { - if (ec || resp.size() != 1) - { - // no global item, or too many - return; - } - self->globalInventoryPath = resp[0]; + if (ec || resp.size() != 1) + { + // no global item, or too many + return; + } + self->globalInventoryPath = resp[0]; }, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/object_mapper", @@ -216,22 +216,21 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate> crow::connections::systemBus->async_method_call( [self](const boost::system::error_code ec, const dbus::utility::ManagedObjectType& resp) { - if (ec) - { - return; - } - self->statuses = resp; - for (auto it = self->statuses.begin(); - it != self->statuses.end();) + if (ec) + { + return; + } + self->statuses = resp; + for (auto it = self->statuses.begin(); it != self->statuses.end();) + { + if (boost::ends_with(it->first.str, "critical") || + boost::ends_with(it->first.str, "warning")) { - if (boost::ends_with(it->first.str, "critical") || - boost::ends_with(it->first.str, "warning")) - { - it++; - continue; - } - it = self->statuses.erase(it); + it++; + continue; } + it = self->statuses.erase(it); + } }, "xyz.openbmc_project.ObjectMapper", "/", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects"); |