From 8641885f861f8b3617517456969eac46ad6bab43 Mon Sep 17 00:00:00 2001
From: Jarrod Johnson <jjohnson2@lenovo.com>
Date: Thu, 25 Jul 2019 08:52:47 -0400
Subject: [PATCH] Fix handling of socket error with neighbor

If a system is half up, a different sort of timeout is given.
Handle this and also preserve the original exception better
if not one of these two.
---
 .../confluent/plugins/hardwaremanagement/redfish.py             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py
index e4d3d6d3..cef02cc0 100644
--- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py
+++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py
@@ -169,7 +169,7 @@ class IpmiCommandWrapper(ipmicommand.Command):
         try:
             super(IpmiCommandWrapper, self).__init__(**kwargs)
         except socket.error as se:
-            if se[1] == 'EHOSTUNREACH':
+            if isinstance(se, socket.timeout) or (len(se) > 1 and se[1] == 'EHOSTUNREACH'):
                 raise exc.TargetEndpointUnreachable('timeout')
             raise
         except pygexc.PyghmiException as pe: