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/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 13bf1be..029220a 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -376,8 +376,11 @@
auto objectMap =
util::getObjMap<bool>(_invName, 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())
{
log<level::ERR>("Error in notify update of tach sensor inventory");