SSH fails with '"parsed": false' error message

Fixes: #15436
This commit is contained in:
Gabor Lekeny 2016-04-16 00:52:35 +02:00 committed by Toshio Kuratomi
parent 8e0b89bdbf
commit 7eab802669
2 changed files with 7 additions and 6 deletions

View file

@ -610,6 +610,7 @@ class Connection(ConnectionBase):
try:
while True:
poll = p.poll()
events = selector.select(timeout)
# We pay attention to timeouts only while negotiating a prompt.
@ -619,7 +620,7 @@ class Connection(ConnectionBase):
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:
if poll is not None:
break
self._terminate_process(p)
raise AnsibleError('Timeout (%ds) waiting for privilege escalation prompt: %s' % (timeout, to_native(b_stdout)))
@ -721,7 +722,7 @@ class Connection(ConnectionBase):
# Now we're awaiting_exit: has the child process exited? If it has,
# and we've read all available output from it, we're done.
if p.poll() is not None:
if poll is not None:
if not selector.get_map() or not events:
break
# We should not see further writes to the stdout/stderr file