2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 02:22:31 +00:00

Support unavailable sensors in redfish

This commit is contained in:
Jarrod Johnson
2019-08-08 15:02:26 -04:00
parent c3176ab86a
commit 3f6e6d4c39

View File

@@ -682,6 +682,10 @@ class IpmiHandler(object):
try:
reading = self.ipmicmd.get_sensor_reading(
sensor['name'])
if reading.unavailable:
self.output.put(msg.SensorReadings([EmptySensor(
sensor['name'])], name=self.node))
continue
except pygexc.IpmiException as ie:
if ie.ipmicode == 203:
self.output.put(msg.SensorReadings([EmptySensor(
@@ -702,6 +706,11 @@ class IpmiHandler(object):
try:
reading = self.ipmicmd.get_sensor_reading(
self.sensormap[sensorname])
if reading.unavailable:
self.output.put(msg.ConfluentResourceUnavailable(
self.node, 'Unavailable'
))
return
if hasattr(reading, 'health'):
reading.health = _str_health(reading.health)
self.output.put(