From 9e734df0ec68b40f7dc64f9ebfd338595dd2ac8b Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 23 Sep 2015 11:19:52 -0400 Subject: [PATCH] Conditionally poll longer if we're still waiting for an auth prompt --- lib/ansible/plugins/connection/ssh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index 80e7d376157..f8fca1bd294 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -444,7 +444,11 @@ class Connection(ConnectionBase): state += 1 while True: - rfd, wfd, efd = select.select(rpipes, [], rpipes, 0.1) + poll_timeout = 0.1 + if state <= states.index('awaiting_escalation'): + poll_timeout = timeout + + rfd, wfd, efd = select.select(rpipes, [], rpipes, poll_timeout) # We pay attention to timeouts only while negotiating a prompt.