Clear inventory data on removal
In case any FRU is removed from the system, the data w.r.t the
FRU, as it is persisted continues to stay on DBus. This sometimes
can be mis-leading as data is displayed for FRU which is actually
not present in the system.
The commit, in case the FRU is removed via delete FRU procedure,
clears all the VPD related data for the FRU and update its
present and functional status.
Test:
Delete any FRU using "deleteFRUVPD" exposed via VPD-Manager,
check the DBus, data related to VPD should be cleared.
Change-Id: Ic61e9a9934333ef9558ac4294a1935575042cb11
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 18c2f04..98e9238 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -32,6 +32,7 @@
{
namespace manager
{
+
Manager::Manager(std::shared_ptr<boost::asio::io_context>& ioCon,
std::shared_ptr<sdbusplus::asio::dbus_interface>& iFace,
std::shared_ptr<sdbusplus::asio::connection>& conn) :
@@ -838,16 +839,11 @@
}
else
{
- // Set present property of FRU as false as it has been removed.
- // CC data for FRU is also removed as
- // a) FRU is not there so CC does not make sense.
- // b) Sensors dependent on Panel uses CC data.
- inventory::InterfaceMap interfaces{
- {"xyz.openbmc_project.Inventory.Item", {{"Present", false}}},
- {"com.ibm.ipzvpd.VINI", {{"CC", Binary{}}}}};
+ inventory::InterfaceMap interfacesPropMap;
+ clearVpdOnRemoval(INVENTORY_PATH + objPath, interfacesPropMap);
inventory::ObjectMap objectMap;
- objectMap.emplace(objPath, move(interfaces));
+ objectMap.emplace(objPath, move(interfacesPropMap));
common::utility::callPIM(move(objectMap));
}