summaryrefslogtreecommitdiff
path: root/redfish-core/lib/thermal.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-02-27 11:09:02 +0300
committerEd Tanous <ed@tanous.net>2022-04-27 17:55:06 +0300
commit02da7c5a626a747ce93aead08ee050678a16c79b (patch)
treee58cf56a8cb0f283a350df58054ce3603d0256f2 /redfish-core/lib/thermal.hpp
parent49328a2b0d67861091678fe46f55bec57bd13990 (diff)
downloadbmcweb-02da7c5a626a747ce93aead08ee050678a16c79b.tar.xz
Simplify sensor path lookups
This commit drops 8k from the binary size. Tested: SensorCollection returns sensor values as expected, same as previously Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ife1dc40ff6745585ac6bc3f99cd5e6c4811baa56
Diffstat (limited to 'redfish-core/lib/thermal.hpp')
-rw-r--r--redfish-core/lib/thermal.hpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 847d17043c..e58e86fa4b 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -37,16 +37,8 @@ inline void requestRoutesThermal(App& app)
return;
}
- auto thermalPaths =
- sensors::dbus::paths.find(sensors::node::thermal);
- if (thermalPaths == sensors::dbus::paths.end())
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName, thermalPaths->second,
+ asyncResp, chassisName, sensors::dbus::thermalPaths,
sensors::node::thermal);
// TODO Need to get Chassis Redundancy information.
@@ -64,14 +56,6 @@ inline void requestRoutesThermal(App& app)
return;
}
- auto thermalPaths =
- sensors::dbus::paths.find(sensors::node::thermal);
- if (thermalPaths == sensors::dbus::paths.end())
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
std::optional<std::vector<nlohmann::json>>
temperatureCollections;
std::optional<std::vector<nlohmann::json>> fanCollections;
@@ -79,7 +63,7 @@ inline void requestRoutesThermal(App& app)
allCollections;
auto sensorsAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName, thermalPaths->second,
+ asyncResp, chassisName, sensors::dbus::thermalPaths,
sensors::node::thermal);
if (!json_util::readJsonPatch(