mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
parent
8e0b89bdbf
commit
7eab802669
2 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue