diff options
| author | Yi Li <adamliyi@msn.com> | 2016-07-01 16:47:16 +0800 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2016-07-29 20:53:20 +0000 |
| commit | 3cb85e97e1dd74037e75ae59f6a432c37a910be4 (patch) | |
| tree | 03583bcdfb1e89c115694dadadd55aed06b13aa2 /obmc | |
| parent | 9df742072de4ead29e821914427956acc2ff5618 (diff) | |
| download | pyphosphor-3cb85e97e1dd74037e75ae59f6a432c37a910be4.tar.gz pyphosphor-3cb85e97e1dd74037e75ae59f6a432c37a910be4.zip | |
Add parameter to Emergency signal of SensorThresholds
When sensor value is out of range of threshold, an "Emergency"
signal will be emitted. Add a "message" parameter to the signal,
to provide detail information on the cause of "Emergency".
This information will be logged in an ESEL.
Partially resolves openbmc/skeleton#64
Change-Id: I501188b36718b8a87582558c349c0316e1092db5
Signed-off-by: Yi Li <adamliyi@msn.com>
Diffstat (limited to 'obmc')
| -rw-r--r-- | obmc/sensors.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/obmc/sensors.py b/obmc/sensors.py index e923859..fcb3ee6 100644 --- a/obmc/sensors.py +++ b/obmc/sensors.py @@ -111,7 +111,10 @@ class SensorThresholds(DbusProperties): if self.Get(iface, 'threshold_state') != current_state and \ current_state == "CRITICAL" and \ self.Get(iface, 'emergency_enabled') is True: - self.Emergency() + message = type(self).__name__ + \ + ' SensorThresholds.check_thresholds(): trigger emergency' + \ + ' signal, sensor value: ' + str(value) + self.Emergency(message) self.Set(iface, 'threshold_state', current_state) worst = self.properties[iface]['worst_threshold_state'] @@ -121,8 +124,8 @@ class SensorThresholds(DbusProperties): return rtn - @dbus.service.signal(IFACE_NAME, signature='') - def Emergency(self): + @dbus.service.signal(IFACE_NAME, signature='s') + def Emergency(self, message): pass |

