Refactor lambda on dBusEventLogEntryGet
Similar to other patches, refactor this lambda into a normal function
so that the successive commits can be more readable.
Tested:
- Redfish service validator passes
Change-Id: I0323af66a301d06667fddd05f83fde19d81cdb2b
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index c65875a..ab5a374 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1778,6 +1778,27 @@
});
}
+inline void afterDBusEventLogEntryGet(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const std::string& entryID, const boost::system::error_code& ec,
+ const dbus::utility::DBusPropertiesMap& resp)
+{
+ if (ec.value() == EBADR)
+ {
+ messages::resourceNotFound(asyncResp->res, "EventLogEntry", entryID);
+ return;
+ }
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR("EventLogEntry (DBus) resp_handler got error {}", ec);
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ fillEventLogLogEntryFromPropertyMap(asyncResp, resp,
+ asyncResp->res.jsonValue);
+}
+
inline void dBusEventLogEntryGet(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, std::string entryID)
{
@@ -1788,25 +1809,7 @@
dbus::utility::getAllProperties(
"xyz.openbmc_project.Logging",
"/xyz/openbmc_project/logging/entry/" + entryID, "",
- [asyncResp, entryID](const boost::system::error_code& ec,
- const dbus::utility::DBusPropertiesMap& resp) {
- if (ec.value() == EBADR)
- {
- messages::resourceNotFound(asyncResp->res, "EventLogEntry",
- entryID);
- return;
- }
- if (ec)
- {
- BMCWEB_LOG_ERROR(
- "EventLogEntry (DBus) resp_handler got error {}", ec);
- messages::internalError(asyncResp->res);
- return;
- }
-
- fillEventLogLogEntryFromPropertyMap(asyncResp, resp,
- asyncResp->res.jsonValue);
- });
+ std::bind_front(afterDBusEventLogEntryGet, asyncResp, entryID));
}
inline void dBusEventLogEntryPatch(