Enhancing misguiding error trace
- There are some of the listed paths below which don't have "Present"
property. Due to this, the FRU present property check was throwing
"Resource not found" error which misguides the user.
- The commit adds support to fix this misguiding error trace.
Paths:
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0/fan0_1
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1/fan1_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1/fan1_1
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2/fan2_1
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3/fan3_1
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4/fan4_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4/fan4_1
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5/fan5_0
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5/fan5_1
Change-Id: I5a8fae3a5dbae428f14ccc90aeba8319a48c11b2
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/libpldmresponder/fru.cpp b/libpldmresponder/fru.cpp
index f8cb6d8..8a04199 100644
--- a/libpldmresponder/fru.cpp
+++ b/libpldmresponder/fru.cpp
@@ -171,17 +171,16 @@
for (const auto& object : objects)
{
const auto& interfaces = object.second;
- bool isPresent = pldm::utils::checkForFruPresence(object.first.str);
- // Do not create fru record if fru is not present.
- // Pick up the next available fru.
- if (!isPresent)
- {
- continue;
- }
for (const auto& interface : interfaces)
{
if (itemIntfsLookup.find(interface.first) != itemIntfsLookup.end())
{
+ // checking fru present property is available or not.
+ if (!pldm::utils::checkForFruPresence(object.first.str))
+ {
+ continue;
+ }
+
// An exception will be thrown by getRecordInfo, if the item
// D-Bus interface name specified in FRU_Master.json does
// not have corresponding config jsons