summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Coca <bcoca@ansible.com>2015-11-13 19:45:21 +0100
committerBrian Coca <bcoca@ansible.com>2015-11-13 19:45:21 +0100
commit634e10e5b81486c65e091a37f35e4942054590ea (patch)
treea005b2521bf6b7f79b6d78aaba5da557af271ab3
parentMerge pull request #13147 from leedm777/connect-timeout (diff)
parentIf ssh died, it's an error, not a timeout (diff)
downloadansible-634e10e5b81486c65e091a37f35e4942054590ea.tar.xz
ansible-634e10e5b81486c65e091a37f35e4942054590ea.zip
Merge pull request #13156 from amenonsen/broken-timeout
If ssh died, it's an error, not a timeout
-rw-r--r--lib/ansible/plugins/connection/ssh.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
index b5cce048e3..8bbc031271 100644
--- a/lib/ansible/plugins/connection/ssh.py
+++ b/lib/ansible/plugins/connection/ssh.py
@@ -414,6 +414,10 @@ class Connection(ConnectionBase):
if not rfd:
if state <= states.index('awaiting_escalation'):
+ # If the process has already exited, then it's not really a
+ # timeout; we'll let the normal error handling deal with it.
+ if p.poll() is not None:
+ break
self._terminate_process(p)
raise AnsibleError('Timeout (%ds) waiting for privilege escalation prompt: %s' % (timeout, stdout))