Fix: Dimm Temp Sensor name change
Dimm names under /redfish/v1/Systems/system/Memory are not matching
with dimm names under /redfish/v1/Chassis/<Baseboard>/Sensors
Tested:
Before: "/redfish/v1/Chassis/<Baseboard>/Sensors/
temperature_DIMM_A1_CPU1"
After: "/redfish/v1/Chassis/<Baseboard>/Sensors/
temperature_CPU1_DIMM_A1"
Change-Id: Ia302d6907eacd3630121c75a1f04fb386ba57d67
Signed-off-by: PavanKumarIntel <pavanx.kumar.martha@intel.com>
diff --git a/src/IntelCPUSensorMain.cpp b/src/IntelCPUSensorMain.cpp
index 643f49d..7d14915 100644
--- a/src/IntelCPUSensorMain.cpp
+++ b/src/IntelCPUSensorMain.cpp
@@ -124,7 +124,18 @@
{
sensorName += " " + item;
}
- sensorName += " CPU" + std::to_string(cpuId);
+
+ std::string cpuStr = "CPU" + std::to_string(cpuId);
+ constexpr const char* subLabel = "DIMM";
+ std::size_t found = label.find(subLabel);
+ if (found != std::string::npos)
+ {
+ sensorName = cpuStr + " " + sensorName;
+ }
+ else
+ {
+ sensorName += " " + cpuStr;
+ }
// converting to Upper Camel case whole name
bool isWordEnd = true;
std::transform(sensorName.begin(), sensorName.end(), sensorName.begin(),