pcie: Don't return error if no PCIe present
Resolves openbmc/bmcweb#98
Tested:
Before the fix:
curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/Systems/system
{
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem",
...
"SystemType": "Physical",
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
"Message": "The request failed due to an internal service error. The service is still operational.",
"MessageArgs": [],
"MessageId": "Base.1.4.0.InternalError",
"Resolution": "Resubmit the request. If the problem persists, consider resetting the service.",
"Severity": "Critical"
}
],
"code": "Base.1.4.0.InternalError",
"message": "The request failed due to an internal service error. The service is still operational."
}
After the fix:
curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/Systems/system
{
"@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem",
...
"SerialNumber": "1318ECA",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Disabled"
},
"SystemType": "Physical"
}
Change-Id: I0cc2a86decdea47164103c901ce7bd631f8adaf2
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 6b8600f..ad61ff4 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -35,9 +35,9 @@
std::vector<std::string> &pcieDevicePaths) {
if (ec)
{
- BMCWEB_LOG_DEBUG << "failed to get PCIe device paths ec: "
+ BMCWEB_LOG_DEBUG << "no PCIe device paths found ec: "
<< ec.message();
- messages::internalError(asyncResp->res);
+ // Not an error, system just doesn't have PCIe info
return;
}
nlohmann::json &pcieDeviceList =