diff options
Diffstat (limited to 'redfish-core/lib')
-rw-r--r-- | redfish-core/lib/processor.hpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp index ea09231fa3..65a3e9cea8 100644 --- a/redfish-core/lib/processor.hpp +++ b/redfish-core/lib/processor.hpp @@ -149,7 +149,7 @@ inline void getCpuDataByInterface( else if (property.first == "EffectiveFamily") { const uint16_t* value = std::get_if<uint16_t>(&property.second); - if (value != nullptr) + if (value != nullptr && *value != 2) { aResp->res.jsonValue["ProcessorId"]["EffectiveFamily"] = "0x" + intToHexString(*value, 4); @@ -163,8 +163,11 @@ inline void getCpuDataByInterface( messages::internalError(aResp->res); return; } - aResp->res.jsonValue["ProcessorId"]["EffectiveModel"] = - "0x" + intToHexString(*value, 4); + if (*value != 0) + { + aResp->res.jsonValue["ProcessorId"]["EffectiveModel"] = + "0x" + intToHexString(*value, 4); + } } else if (property.first == "Id") { @@ -184,8 +187,11 @@ inline void getCpuDataByInterface( messages::internalError(aResp->res); return; } - aResp->res.jsonValue["ProcessorId"]["MicrocodeInfo"] = - "0x" + intToHexString(*value, 8); + if (*value != 0) + { + aResp->res.jsonValue["ProcessorId"]["MicrocodeInfo"] = + "0x" + intToHexString(*value, 8); + } } else if (property.first == "Step") { @@ -195,8 +201,11 @@ inline void getCpuDataByInterface( messages::internalError(aResp->res); return; } - aResp->res.jsonValue["ProcessorId"]["Step"] = - "0x" + intToHexString(*value, 4); + if (*value != 0) + { + aResp->res.jsonValue["ProcessorId"]["Step"] = + "0x" + intToHexString(*value, 4); + } } } } @@ -344,7 +353,7 @@ inline void getCpuAssetData(std::shared_ptr<bmcweb::AsyncResp> aResp, aResp->res.jsonValue["PartNumber"] = *partNumber; } - if (sparePartNumber != nullptr) + if (sparePartNumber != nullptr && !sparePartNumber->empty()) { aResp->res.jsonValue["SparePartNumber"] = *sparePartNumber; } |