Redfish: Enhance and fix power/thermal sensors
Made the following enhancements for Redfish power/thermal sensors:
* Now dynamically obtains the DBus object path to pass to
GetManagedObjects() when getting sensor values. Was previously
hard-coded to "/" which didn't work on some systems.
* Added "fan_tach" to list of DBus sensor types returned when thermal
sensors are requested.
* Added support for one-chassis systems.
Made the following fixes:
* Fixed @odata.id value when power sensors are requested. Previously
returned "/redfish/v1/Chassis/chassis/Thermal".
* Renamed "PowerSupply" to "PowerSupplies" to conform to schema.
* Removed 6 properties that were being returned for PowerSupplies that
were not in the schema.
* Added check to make sure no sensors of the wrong type were being
returned. Previously if the same connection (service) provided both power
and thermal sensors, both types of sensors were always returned.
Test Plan:
https://gist.github.com/smccarney/79186e8510ba5479e846f2592d44d059
Tested: Verified the URLs /redfish/v1/Chassis/<chassis>/Power and
/redfish/v1/Chassis/<chassis>/Thermal return the correct sensor
names and values on a Witherspoon system. Verified fixes listed
above worked. Ran Redfish Service Validator.
Change-Id: I4bae615cb61fc436b3c0a9a5c4d6b4566a3ddaa6
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 5c0aa5a..f266c40 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -70,10 +70,7 @@
res.jsonValue["@odata.id"] =
"/redfish/v1/Chassis/" + chassisName + "/Thermal";
-#ifdef BMCWEB_ENABLE_REDFISH_ONE_CHASSIS
- res.end();
- return;
-#endif
+
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
res, chassisName, typeList, "Thermal");