2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-07 08:32:29 +00:00

Always provide a badreadings output, even if empty

This commit is contained in:
Jarrod Johnson
2025-02-04 09:11:53 -05:00
parent b9f4051396
commit 564e136dc5

View File

@@ -1186,13 +1186,12 @@ class IpmiHandler(object):
health = response['health']
health = _str_health(health)
self.output.put(msg.HealthSummary(health, self.node))
if 'badreadings' in response:
badsensors = []
for reading in response['badreadings']:
if hasattr(reading, 'health'):
reading.health = _str_health(reading.health)
badsensors.append(reading)
self.output.put(msg.SensorReadings(badsensors, name=self.node))
badsensors = []
for reading in response.get('badreadings', []):
if hasattr(reading, 'health'):
reading.health = _str_health(reading.health)
badsensors.append(reading)
self.output.put(msg.SensorReadings(badsensors, name=self.node))
else:
raise exc.InvalidArgumentException('health is read-only')