Monitor : avoid mapper lookups in Tach Sensor
There is a race condition that can fail in certain situations where
mapper has not completed introspection, causing a lookup failure and
D-Bus exception. This change uses a hard-coded service name, thus
avoiding the lookup and allowing tach sensors to write status directly
to inventory.
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: If6ad105055762c6240b36d904d169094088b7c81
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index 9856242..ba67918 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -432,9 +432,9 @@
util::getObjMap<bool>(_name, util::OPERATIONAL_STATUS_INTF,
util::FUNCTIONAL_PROPERTY, functional);
- auto response = util::SDBusPlus::lookupAndCallMethod(
- _bus, util::INVENTORY_PATH, util::INVENTORY_INTF, "Notify",
- objectMap);
+ auto response = util::SDBusPlus::callMethod(
+ _bus, util::INVENTORY_SVC, util::INVENTORY_PATH,
+ util::INVENTORY_INTF, "Notify", objectMap);
if (response.is_method_error())
{