Correct assertion when restoring system VPD
The vpd parser would assert if it found a FRU entry
tagged as system VPD in the JSON, but did not find a
Motherboard tagged item on D-Bus corresponding to that
entry.
This check was done before attempting to restore system
VPD. This check is no longer valid if we need the chassis
object to inherit properties from the Motherboard.
To simplify this, this commit just changes that assertion
to an if clause.
Tested:
Tested with a JSON where the chassis inherits properties
from the motehrboard EEPROM and verified that we no longer
assert.
Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: I7b951433a8a5fdf859756141598d9f7530fd03c0
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index a678adb..089ad9e 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -738,14 +738,12 @@
MapperResponse subTree =
getObjectSubtreeForInterfaces(pimPath, 0, interfaces);
- // Skip system vpd restore if object path is not generated
- // for motherboard, Implies first boot.
- if (subTree.size() != 0)
+ // Attempt system VPD restore if we have a motherboard
+ // object in the inventory.
+ if ((subTree.size() != 0) &&
+ (subTree.find(pimPath + std::string(objectPath)) !=
+ subTree.end()))
{
- assert(
- (subTree.find(pimPath + std::string(objectPath)) !=
- subTree.end()));
-
updatedEeproms = restoreSystemVPD(vpdMap, objectPath);
}
else