Don't raise AnsibleConnectionFailure if the ssh process has already died. (#53534)

* Don't raise AnsibleConnectionFailure if the ssh_process has already died. Fixes #53487

* Better support for file not found messages

* Add changelog fragment
This commit is contained in:
Matt Martz 2019-03-12 10:41:30 -05:00 committed by GitHub
parent 15303b05ef
commit e9f9bcae6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View file

@ -975,8 +975,8 @@ class ActionBase(with_metaclass(ABCMeta, object)):
# try to figure out if we are missing interpreter
if self._used_interpreter is not None:
match = '%s: No such file or directory' % self._used_interpreter.lstrip('!#')
if match in data['module_stderr'] or match in data['module_stdout']:
match = re.compile('%s: (?:No such file or directory|not found)' % self._used_interpreter.lstrip('!#'))
if match.search(data['module_stderr']) or match.search(data['module_stdout']):
data['msg'] = "The module failed to execute correctly, you probably need to set the interpreter."
# always append hint