mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
committed by
Toshio Kuratomi
parent
8e0b89bdbf
commit
7eab802669
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user