diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 536af948..9142fdc8 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -92,6 +92,8 @@ class IpmiCommandWrapper(ipmicommand.Command): def __init__(self, node, cfm, **kwargs): self.cfm = cfm self.node = node + self._inhealth = False + self._lasthealth = None self._attribwatcher = cfm.watch_attributes( (node,), ('secret.hardwaremanagementuser', 'secret.hardwaremanagementpassword', 'secret.ipmikg', @@ -113,6 +115,16 @@ class IpmiCommandWrapper(ipmicommand.Command): # then do nothing pass + def get_health(self): + if self._inhealth: + while self._inhealth: + eventlet.sleep(0.1) + return self._lasthealth + self._inhealth = True + self._lasthealth = super(IpmiCommandWrapper, self).get_health() + self._inhealth = False + return self._lasthealth + def _ipmi_evtloop(): while True: @@ -845,7 +857,7 @@ class IpmiHandler(object): return def _str_health(health): - if health == 'unknown': + if isinstance(health, str): return health if pygconstants.Health.Failed & health: health = 'failed'