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>
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 @@
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 @@
return rtn
- @dbus.service.signal(IFACE_NAME, signature='')
- def Emergency(self):
+ @dbus.service.signal(IFACE_NAME, signature='s')
+ def Emergency(self, message):
pass