From b1666020a9564bd4adef5f11b5f57fa78c0e2974 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 13 Oct 2016 15:13:00 -0400 Subject: [PATCH] adds additional exception handling in open() (#18003) The open() method will now catch a socket.timeout exception and raise a ShellError. --- lib/ansible/module_utils/shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/shell.py b/lib/ansible/module_utils/shell.py index fa78cb3a37..266347f0dc 100644 --- a/lib/ansible/module_utils/shell.py +++ b/lib/ansible/module_utils/shell.py @@ -106,6 +106,8 @@ class Shell(object): raise ShellError("unable to resolve host name") except AuthenticationException: raise ShellError('Unable to authenticate to remote device') + except socket.timeout: + raise ShellError("timeout trying to connect to remote device") except socket.error: exc = get_exception() if exc.errno == 60: