2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Merge "Fix problems with unrecognized health"

This commit is contained in:
Zuul 2019-09-17 13:00:31 +00:00 committed by Gerrit Code Review
commit d99e8fdf1c

View File

@ -131,6 +131,11 @@ class SensorReading(object):
self.name = sensor['name']
else:
self.name = healthinfo['Name']
self.health = _healthmap.get(
healthinfo.get('Status', {}).get(
'Health', None), const.Health.Warning)
self.states = [healthinfo.get('Status', {}).get('Health',
'Unknown')]
self.health = _healthmap[healthinfo['Status']['Health']]
self.states = [healthinfo['Status']['Health']]
self.value = value