Remove asset when drive removed
This removes the asset interface when a drive is
removed so the old serial number and fru fields
don't show up in Redfish.
Tested: Had present flip to not present after
predfined period, when not present, no fru fields
in redfish
Change-Id: Iea90509bdca26758472105c55001abac951128d3
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/hsbp-manager/src/hsbp_manager.cpp b/hsbp-manager/src/hsbp_manager.cpp
index 57d3477..4780d18 100644
--- a/hsbp-manager/src/hsbp_manager.cpp
+++ b/hsbp-manager/src/hsbp_manager.cpp
@@ -213,6 +213,12 @@
objServer.remove_interface(associations);
}
+ void removeAsset()
+ {
+ objServer.remove_interface(assetIface);
+ assetIface = nullptr;
+ }
+
void createAsset(
const boost::container::flat_map<std::string, std::string>& data)
{
@@ -285,7 +291,7 @@
logDeviceRemoved("Drive", std::to_string(index), serialNumber);
serialNumber = "N/A";
serialNumberInitialized = false;
- return;
+ removeAsset();
}
else if (isPresent && !loggedPresent)
{