Fix for missing "Functional" property in dbus for GV cards
Handle the case if "Functional" and/or "Present" properties are
not sent by the host
Test: Tested on a witherspoon which has all 6 GV cards attached.
alpana07> curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors/gv100card0 {
"@odata.context": "/redfish/v1/$metadata#Processor.Processor",
"@odata.id": "/redfish/v1/Systems/system/Processors/gv100card0",
"@odata.type": "#Processor.v1_3_1.Processor",
"Id": "gv100card0",
"Name": "Processor",
"ProcessorType": "Accelerator",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
"State" --> Enabled, property "Present" either not found OR found with value true.
"Health"--> OK, interprets "Functional" either not present OR present&true.
Change-Id: Ic2a6adb58f8a8b5559184a5ed3d34b28df1cd188
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
diff --git a/redfish-core/lib/cpudimm.hpp b/redfish-core/lib/cpudimm.hpp
index 9b9d9cb..6e658df 100644
--- a/redfish-core/lib/cpudimm.hpp
+++ b/redfish-core/lib/cpudimm.hpp
@@ -375,7 +375,6 @@
aResp->res.jsonValue["Name"] = "Processor";
const bool* accPresent = nullptr;
const bool* accFunctional = nullptr;
- std::string state = "";
for (const auto& property : properties)
{
@@ -389,28 +388,28 @@
}
}
- if (!accPresent || !accFunctional)
- {
- BMCWEB_LOG_DEBUG << "Required properties missing in DBUS "
- "response";
- messages::internalError(aResp->res);
- return;
- }
+ std::string state = "Enabled";
+ std::string health = "OK";
- if (*accPresent && *accFunctional)
- {
- state = "Enabled";
- }
- else if (*accPresent)
- {
- state = "UnavailableOffline";
- }
- else
+ if (accPresent != nullptr && *accPresent == false)
{
state = "Absent";
}
+
+ if ((accFunctional != nullptr) && (*accFunctional == false))
+ {
+ if (state == "Enabled")
+ {
+ health = "Critical";
+ }
+ else
+ {
+ health = "UnavailableOffline";
+ }
+ }
+
aResp->res.jsonValue["Status"]["State"] = state;
- aResp->res.jsonValue["Status"]["Health"] = "OK";
+ aResp->res.jsonValue["Status"]["Health"] = health;
aResp->res.jsonValue["ProcessorType"] = "Accelerator";
},
service, objPath, "org.freedesktop.DBus.Properties", "GetAll", "");