openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
154 stars 131 forks source link

bmcweb/redfish-core/lib/sensor.hpp does not check if sensor type is power #221

Closed esm closed 3 years ago

esm commented 3 years ago

Describe the bug bmcweb/redfish-core/lib/sensor.hpp does not check if type is power. Because "/xyz/openbmc_project/sensors/power" is a path in both the power node and the sensor node ( as defined in lines 62 and 64 ) of bmcweb/redfish-core/lib/sensors.hpp, /xyz/openbmc_project/sensors/power satisfies the if condition if (sensorsAsyncResp->chassisSubNode == sensors::node::sensors) on line 942 and never reaches else if (sensorType == "power") on line 996. Therefore my PowerConsumedWatts is not displayed.

edtanous commented 3 years ago

Please use the bug template. Also, this sounds like a question more than a bug report, which is better taken up on discord or the mailing list.