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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user