Allocate an explicit stdin in async_wrapper (#53410)

* add changelog fragment

* Add stdin async test

* Allocate an explicit stdin in async_wrapper. Fixes #50758
pull/53466/head
Matt Martz 6 years ago committed by GitHub
parent 72eb8672bf
commit 264d9a9008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- async_wrapper - Allocate an explicit stdin (https://github.com/ansible/ansible/issues/50758)

@ -148,7 +148,8 @@ def _run_module(wrapped_cmd, jid, job_path):
interpreter = _get_interpreter(cmd[0])
if interpreter:
cmd = interpreter + cmd
script = subprocess.Popen(cmd, shell=False, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
script = subprocess.Popen(cmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(outdata, stderr) = script.communicate()
if PY3:

@ -280,3 +280,9 @@
file:
path: '{{ custom_async_tmp }}'
state: absent
- name: Test that async has stdin
command: >
{{ ansible_python_interpreter|default('/usr/bin/python') }} -c 'import os; os.fdopen(os.dup(0), "r")'
async: 1
poll: 1

Loading…
Cancel
Save