2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 04:07:48 +00:00

Fix problems with unrecognized health

This fixes problems

Change-Id: I2d198a2b675103ed9c51fd679835c79148ed829e
This commit is contained in:
Jarrod Johnson 2019-09-13 14:01:50 -04:00
parent b5dc8a8b9d
commit c12253042f

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