wait_for_connection: also retry interpreter discovery (#67040)

self._discovered_interpreter_key is None unless a previous iteration
has attempted discovery.  In that case, force re-discovery, as the
previous attempt certainly failed.
This commit is contained in:
James Cassell 2020-02-04 14:40:09 -05:00 committed by GitHub
parent f4a80bb600
commit fd954a9c5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
bugfixes:
- wait_for_connection - with pipelining enabled, interpreter discovery would
fail if the first connection attempt was not successful

View file

@ -79,6 +79,9 @@ class ActionModule(ActionBase):
def ping_module_test(connect_timeout):
''' Test ping module, if available '''
display.vvv("wait_for_connection: attempting ping module test")
# re-run interpreter discovery if we ran it in the first iteration
if self._discovered_interpreter_key:
task_vars['ansible_facts'].pop(self._discovered_interpreter_key, None)
# call connection reset between runs if it's there
try:
self._connection.reset()