summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-08-29 08:47:48 -0400
committerGitHub <noreply@github.com>2016-08-29 08:47:48 -0400
commitc16f34bf8ecfb93fbaa308adfcdd7872924f1173 (patch)
treee3e6805132c026851ef44c80b9d3c50b20abd419
parent2179677294c8e6a86c8312804dda09961811466e (diff)
parent820260b22d57aca0ed75fdb81c3b65123788e06d (diff)
downloadansible-c16f34bf8ecfb93fbaa308adfcdd7872924f1173.tar.gz
Merge pull request #17279 from privateip/shell
catches timeout error when connecting to remote host in shell
-rw-r--r--lib/ansible/module_utils/shell.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/shell.py b/lib/ansible/module_utils/shell.py
index ac7b038686..1094601f40 100644
--- a/lib/ansible/module_utils/shell.py
+++ b/lib/ansible/module_utils/shell.py
@@ -106,6 +106,11 @@ class Shell(object):
raise ShellError("unable to resolve host name")
except AuthenticationException:
raise ShellError('Unable to authenticate to remote device')
+ except socket.error:
+ exc = get_exception()
+ if exc.errno == 60:
+ raise ShellError('timeout trying to connect to host')
+ raise
if self.kickstart:
self.shell.sendall("\n")