From c12253042f6ebd4b1c017a58a608530c3636be96 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 13 Sep 2019 14:01:50 -0400 Subject: [PATCH] Fix problems with unrecognized health This fixes problems Change-Id: I2d198a2b675103ed9c51fd679835c79148ed829e --- pyghmi/redfish/command.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 6c94045d..c6d68042 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -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