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, interprets "Present" --> true
"Health"--> OK, interprets either "Functional" not present OR present&true.

Change-Id: If967623d1c85f837195c88c2b3704f326d371c13
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
diff --git a/redfish-core/lib/cpudimm.hpp b/redfish-core/lib/cpudimm.hpp
index ed5e641..ea0cee5 100644
--- a/redfish-core/lib/cpudimm.hpp
+++ b/redfish-core/lib/cpudimm.hpp
@@ -328,7 +328,6 @@
             aResp->res.jsonValue["Name"] = "Processor";
             const bool* accPresent = nullptr;
             const bool* accFunctional = nullptr;
-            std::string state = "";
 
             for (const auto& property : properties)
             {
@@ -342,28 +341,24 @@
                 }
             }
 
-            if (!accPresent || !accFunctional)
+            if ((accPresent != nullptr) && (*accPresent == false))
             {
-                BMCWEB_LOG_DEBUG << "Required properties missing in DBUS "
-                                    "response";
-                messages::internalError(aResp->res);
-                return;
-            }
-
-            if (*accPresent && *accFunctional)
-            {
-                state = "Enabled";
-            }
-            else if (*accPresent)
-            {
-                state = "UnavailableOffline";
+                aResp->res.jsonValue["Status"]["State"] = "Absent";
+                aResp->res.jsonValue["Status"]["Health"] = "OK";
             }
             else
             {
-                state = "Absent";
+                aResp->res.jsonValue["Status"]["State"] = "Enabled";
+
+                if ((accFunctional != nullptr) && (*accFunctional == false))
+                {
+                    aResp->res.jsonValue["Status"]["Health"] = "Critical";
+                }
+                else
+                {
+                    aResp->res.jsonValue["Status"]["Health"] = "OK";
+                }
             }
-            aResp->res.jsonValue["Status"]["State"] = state;
-            aResp->res.jsonValue["Status"]["Health"] = "OK";
             aResp->res.jsonValue["ProcessorType"] = "Accelerator";
         },
         service, objPath, "org.freedesktop.DBus.Properties", "GetAll", "");