From a0ae523768418a4a79be5a747da4344b5a23fc17 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 29 Jul 2014 09:49:52 -0400 Subject: [PATCH] Fix timeout on persistent IPMI session If there is a persistent IPMI session and the first to notice was a user request it would fail with unexpected error. Correct the situation to expect the error and report more precisely as to the cause. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 3cf35da1..99f32399 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -21,6 +21,7 @@ import eventlet.green.threading as threading import eventlet.greenpool as greenpool import eventlet.queue import pyghmi.constants as pygconstants +import pyghmi.exceptions as pygexc import pyghmi.ipmi.console as console import pyghmi.ipmi.command as ipmicommand import socket @@ -205,8 +206,13 @@ class IpmiIterator(object): def perform_request(operator, node, element, configdata, inputdata, cfg): - return IpmiHandler(operator, node, element, configdata, inputdata, cfg - ).handle_request() + try: + return IpmiHandler(operator, node, element, configdata, inputdata, cfg + ).handle_request() + except pygexc.IpmiException as ipmiexc: + excmsg = str(ipmiexc) + if excmsg == 'Session no longer connected': + return msg.ConfluentTargetTimeout(node) persistent_ipmicmds = {}