Destroy redundancy sensor before re-creation.
The mapper gets confused if a removed comes too soon
before an add and removes the interface. Fix this.
Tested: Showed up in the mapper on boot.
Change-Id: Iad11cc5f30f8a1de594810cd19cbb415799a1fb8
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/FanMain.cpp b/src/FanMain.cpp
index 0010ec5..244c104 100644
--- a/src/FanMain.cpp
+++ b/src/FanMain.cpp
@@ -358,7 +358,8 @@
"/xyz/openbmc_project/sensors/fan_tach/" +
sensor.second->name);
}
- systemRedundancy = std::make_unique<RedundancySensor>(
+ systemRedundancy = nullptr;
+ systemRedundancy = std::make_shared<RedundancySensor>(
std::get<uint64_t>(findCount->second), sensorList,
objectServer);