diff options
author | James Feist <james.feist@linux.intel.com> | 2020-03-13 02:32:08 +0300 |
---|---|---|
committer | James Feist <james.feist@linux.intel.com> | 2020-03-17 19:33:52 +0300 |
commit | fe30672809d9dcf83f6cab821d02650b250664b9 (patch) | |
tree | fafba78ccfd37847fe927057c30213979bbff46e /redfish-core/lib/update_service.hpp | |
parent | f857e9ae6f6e7d567462f32cb5d9d3a7b581535e (diff) | |
download | bmcweb-fe30672809d9dcf83f6cab821d02650b250664b9.tar.xz |
Task: Add payload support
This adds the payload values to task responses.
Tested: passed validator
Change-Id: I50467e28ce8142d198f916ea0c63bd413edcd524
Signed-off-by: James Feist <james.feist@linux.intel.com>
Diffstat (limited to 'redfish-core/lib/update_service.hpp')
-rw-r--r-- | redfish-core/lib/update_service.hpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 3ca7721cbd..e9793ebe70 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -58,7 +58,8 @@ static void activateImage(const std::string &objPath, // Note that asyncResp can be either a valid pointer or nullptr. If nullptr // then no asyncResp updates will occur static void softwareInterfaceAdded(std::shared_ptr<AsyncResp> asyncResp, - sdbusplus::message::message &m) + sdbusplus::message::message &m, + const crow::Request &req) { std::vector<std::pair< std::string, @@ -81,10 +82,10 @@ static void softwareInterfaceAdded(std::shared_ptr<AsyncResp> asyncResp, // Retrieve service and activate crow::connections::systemBus->async_method_call( - [objPath, asyncResp]( - const boost::system::error_code error_code, - const std::vector<std::pair< - std::string, std::vector<std::string>>> &objInfo) { + [objPath, asyncResp, + req](const boost::system::error_code error_code, + const std::vector<std::pair< + std::string, std::vector<std::string>>> &objInfo) { if (error_code) { BMCWEB_LOG_DEBUG << "error_code = " << error_code; @@ -188,6 +189,7 @@ static void softwareInterfaceAdded(std::shared_ptr<AsyncResp> asyncResp, objPath.str + "'"); task->startTimer(std::chrono::minutes(5)); task->populateResp(asyncResp->res); + task->payload.emplace(req); } fwUpdateInProgress = false; }, @@ -244,9 +246,9 @@ static void monitorForSoftwareAvailable(std::shared_ptr<AsyncResp> asyncResp, } }); - auto callback = [asyncResp](sdbusplus::message::message &m) { + auto callback = [asyncResp, req](sdbusplus::message::message &m) { BMCWEB_LOG_DEBUG << "Match fired"; - softwareInterfaceAdded(asyncResp, m); + softwareInterfaceAdded(asyncResp, m, req); }; fwUpdateInProgress = true; |