mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
While the previous work on the foon class can't be quite recycled, it's still a nice abstraction.
This commit is contained in:
@@ -63,7 +63,6 @@ PROCESS_LOCKFILE = tempfile.TemporaryFile()
|
||||
|
||||
from foon import Foon
|
||||
|
||||
FOON = Foon()
|
||||
|
||||
################################################
|
||||
|
||||
@@ -1058,11 +1057,10 @@ class Runner(object):
|
||||
|
||||
# *****************************************************
|
||||
|
||||
def _parallel_exec(self, hosts):
|
||||
def _parallel_exec(self, params):
|
||||
''' handles mulitprocessing when more than 1 fork is required '''
|
||||
|
||||
FOON.set_size(self.forks)
|
||||
return FOON.map(_executor_hook, hosts)
|
||||
return self.foon.map(_executor_hook, params)
|
||||
|
||||
# *****************************************************
|
||||
|
||||
@@ -1114,6 +1112,8 @@ class Runner(object):
|
||||
if self.forks == 0 or self.forks > len(hosts):
|
||||
self.forks = len(hosts)
|
||||
|
||||
self.foon = Foon(self.forks)
|
||||
|
||||
if p and getattr(p, 'BYPASS_HOST_LOOP', None):
|
||||
|
||||
# Expose the current hostgroup to the bypassing plugins
|
||||
|
||||
Reference in New Issue
Block a user