mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #6283 from magicrobotmonkey/upstream
fix missing stdin in _parallel_runner Tested with GIST https://gist.github.com/risaacson/7290d30a612e0c70ea1b. Passes "make tests" Passes non_destructive tests.
This commit is contained in:
commit
4993cb57f4
1 changed files with 9 additions and 1 deletions
|
@ -1075,9 +1075,17 @@ class Runner(object):
|
||||||
job_queue.put(host)
|
job_queue.put(host)
|
||||||
result_queue = manager.Queue()
|
result_queue = manager.Queue()
|
||||||
|
|
||||||
|
try:
|
||||||
|
fileno = sys.stdin.fileno()
|
||||||
|
except ValueError:
|
||||||
|
fileno = None
|
||||||
|
|
||||||
workers = []
|
workers = []
|
||||||
for i in range(self.forks):
|
for i in range(self.forks):
|
||||||
new_stdin = os.fdopen(os.dup(sys.stdin.fileno()))
|
if fileno is not None:
|
||||||
|
new_stdin = os.fdopen(os.dup(fileno))
|
||||||
|
else:
|
||||||
|
new_stdin = None
|
||||||
prc = multiprocessing.Process(target=_executor_hook,
|
prc = multiprocessing.Process(target=_executor_hook,
|
||||||
args=(job_queue, result_queue, new_stdin))
|
args=(job_queue, result_queue, new_stdin))
|
||||||
prc.start()
|
prc.start()
|
||||||
|
|
Loading…
Reference in a new issue