2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Pass along unavailable info to client

This commit is contained in:
Jarrod Johnson 2020-04-03 12:33:55 -04:00
parent 2567503662
commit 7e86a72872

View File

@ -855,6 +855,10 @@ class IpmiHandler(object):
raise
if hasattr(reading, 'health'):
reading.health = _str_health(reading.health)
if hasattr(reading, 'unavailable') and reading.unavailable:
self.output.put(msg.SensorReadings([EmptySensor(
reading.name)], name=self.node))
continue
readings.append(reading)
self.output.put(msg.SensorReadings(readings, name=self.node))
else:
@ -870,9 +874,13 @@ class IpmiHandler(object):
self.ipmicmd.sensormap[sensorname])
if hasattr(reading, 'health'):
reading.health = _str_health(reading.health)
self.output.put(
msg.SensorReadings([reading],
name=self.node))
if hasattr(reading, 'unavailable') and reading.unavailable:
self.output.put(msg.SensorReadings([EmptySensor(
reading.name)], name=self.node))
else:
self.output.put(
msg.SensorReadings([reading],
name=self.node))
except pygexc.IpmiException as ie:
if ie.ipmicode == 203:
self.output.put(msg.ConfluentResourceUnavailable(