blob: 6af0a5702d385483ab31850127d14961db73561b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
From 6b4071c12bdcc3bd20e72a7bd2eed19ff14b97af Mon Sep 17 00:00:00 2001
From: Zhikui Ren <zhikui.ren@intel.com>
Date: Wed, 12 May 2021 19:11:08 -0700
Subject: [PATCH] allow dbus sensors without thresholds
catch dbus exceptions when query for thresholds interfaces.
log messages and continue.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
---
dbus/dbusconfiguration.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 55151d3..fd7a138 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -286,13 +286,15 @@ void populatePidInfo(
{
interface = thresholds::criticalInterface;
}
- const std::string& path = sensorConfig.at(info.inputs.front()).readPath;
- DbusHelper helper(sdbusplus::bus::new_system());
- std::string service = helper.getService(interface, path);
double reading = 0;
try
{
+ const std::string& path = sensorConfig.at(info.inputs.front()).readPath;
+
+ DbusHelper helper(sdbusplus::bus::new_system());
+ std::string service = helper.getService(interface, path);
+
helper.getProperty(service, path, interface, *thresholdProperty,
reading);
}
--
2.17.1
|