From 24eb872090b7fca438930cdfcfc68f7eb23215f4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 13 Jul 2015 10:15:03 -0400 Subject: [PATCH] Add 'type' field to sensors In sensors/ and health/, put 'type' field in to clarify the sensor reading category. --- confluent_server/confluent/messages.py | 2 ++ confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 144244fa..7b02e436 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -740,6 +740,8 @@ class SensorReadings(ConfluentMessage): sensordict['states'] = sensor['states'] if 'health' in sensor: sensordict['health'] = sensor['health'] + if 'type' in sensor: + sensordict['type'] = sensor['type'] readings.append(sensordict) if self.notnode: self.kvpairs = {'sensors': readings} diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 0c6fb43e..c82753c3 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -280,7 +280,9 @@ persistent_ipmicmds = {} def _dict_sensor(pygreading): retdict = {'name': pygreading.name, 'value': pygreading.value, 'states': pygreading.states, 'units': pygreading.units, - 'health': _str_health(pygreading.health)} + 'health': _str_health(pygreading.health), + 'type': pygreading.type, + } return retdict