From 0672666e42ae3275c596f02d8db8c6a6a4387ec4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 12 Apr 2016 14:16:15 -0400 Subject: [PATCH] Assure that get_health always updates inhealth If an unforseen circumstance occurs while trying to get health, make sure we recognize that scenario. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 561a6ad6..9ce05343 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -123,7 +123,11 @@ class IpmiCommandWrapper(ipmicommand.Command): eventlet.sleep(0.1) return self._lasthealth self._inhealth = True - self._lasthealth = super(IpmiCommandWrapper, self).get_health() + try: + self._lasthealth = super(IpmiCommandWrapper, self).get_health() + except Exception: + self._inhealth = False + raise self._inhealth = False return self._lasthealth