summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/command.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/command.py b/openshift-storage-libs/openshiftstoragelibs/command.py
index 06912915..e75bbcaa 100644
--- a/openshift-storage-libs/openshiftstoragelibs/command.py
+++ b/openshift-storage-libs/openshiftstoragelibs/command.py
@@ -13,6 +13,10 @@ def cmd_run(cmd, hostname, raise_on_error=True):
str: Stripped shell command's stdout value if not None.
"""
ret, out, err = g.run(hostname, cmd, "root")
+ if ("no ssh connection" in err.lower() or
+ "tls handshake timeout" in err.lower()):
+ g.ssh_close_connection(hostname)
+ ret, out, err = g.run(hostname, cmd, "root")
if raise_on_error:
msg = ("Failed to execute command '%s' on '%s' node. Got non-zero "
"return code '%s'. Err: %s" % (cmd, hostname, ret, err))