summaryrefslogtreecommitdiff
path: root/redfish-core/lib/sensors.hpp
diff options
context:
space:
mode:
authorKrzysztof Grobelny <krzysztof.grobelny@intel.com>2021-10-29 17:00:07 +0300
committerKrzysztof Grobelny <krzysztof.grobelny@intel.com>2021-10-29 17:01:36 +0300
commit021d32cf907222cd72a5b9d2fe2e8159dd4bf083 (patch)
treeba3355c38418460aab292cf80ec975c23a1b4d90 /redfish-core/lib/sensors.hpp
parent02f1cd9b2fc4d18f098c89e356119a3a5ea793eb (diff)
downloadbmcweb-021d32cf907222cd72a5b9d2fe2e8159dd4bf083.tar.xz
Revert "Use AsyncResp in retrieveUriToDbusMap"
This reverts commit 9d832618c74052bd445d6e8b3461946f3c431ca3. Reason for revert: Power schema should not be returned as reposponse to POST request Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Change-Id: I01806a8c24c67f264dab4e9972497323c1499017
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r--redfish-core/lib/sensors.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index d371378616..f9d806b89c 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -2960,10 +2960,9 @@ inline void setSensorsOverride(
* @param node Node (group) of sensors. See sensors::node for supported values
* @param mapComplete Callback to be called with retrieval result
*/
-inline void
- retrieveUriToDbusMap(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& chassis, const std::string& node,
- SensorsAsyncResp::DataCompleteCb&& mapComplete)
+inline void retrieveUriToDbusMap(const std::string& chassis,
+ const std::string& node,
+ SensorsAsyncResp::DataCompleteCb&& mapComplete)
{
auto pathIt = sensors::dbus::paths.find(node);
if (pathIt == sensors::dbus::paths.end())
@@ -2973,8 +2972,10 @@ inline void
return;
}
+ auto res = std::make_shared<crow::Response>();
+ auto asyncResp = std::make_shared<bmcweb::AsyncResp>(*res);
auto callback =
- [asyncResp, mapCompleteCb{std::move(mapComplete)}](
+ [res, asyncResp, mapCompleteCb{std::move(mapComplete)}](
const boost::beast::http::status status,
const boost::container::flat_map<std::string, std::string>&
uriToDbus) { mapCompleteCb(status, uriToDbus); };