1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Update debug messages and comments

The comment was taken literally from lib/plugins/strategy/linear.py and
makes no sense in free.py where we have no noop tasks.

Also update the debug messages.
This commit is contained in:
Christoph Dittmann 2015-12-02 10:56:10 +01:00
parent c6e400fbea
commit 267199fdd5

View file

@ -147,8 +147,7 @@ class StrategyModule(StrategyBase):
if len(included_files) > 0: if len(included_files) > 0:
all_blocks = dict((host, []) for host in hosts_left) all_blocks = dict((host, []) for host in hosts_left)
for included_file in included_files: for included_file in included_files:
# included hosts get the task list while those excluded get an equal-length display.debug("collecting new blocks for %s" % included_file)
# list of noop tasks, to make sure that they continue running in lock-step
try: try:
new_blocks = self._load_included_file(included_file, iterator=iterator) new_blocks = self._load_included_file(included_file, iterator=iterator)
except AnsibleError as e: except AnsibleError as e:
@ -157,17 +156,18 @@ class StrategyModule(StrategyBase):
display.warning(str(e)) display.warning(str(e))
continue continue
display.debug("generating all_blocks data")
display.debug("done generating all_blocks data")
for new_block in new_blocks: for new_block in new_blocks:
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, task=included_file._task) task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, task=included_file._task)
final_block = new_block.filter_tagged_tasks(play_context, task_vars) final_block = new_block.filter_tagged_tasks(play_context, task_vars)
for host in hosts_left: for host in hosts_left:
if host in included_file._hosts: if host in included_file._hosts:
all_blocks[host].append(final_block) all_blocks[host].append(final_block)
display.debug("done collecting new blocks for %s" % included_file)
display.debug("adding all collected blocks from %d included file(s) to iterator" % len(included_files))
for host in hosts_left: for host in hosts_left:
iterator.add_tasks(host, all_blocks[host]) iterator.add_tasks(host, all_blocks[host])
display.debug("done adding collected blocks to iterator")
# pause briefly so we don't spin lock # pause briefly so we don't spin lock
time.sleep(0.05) time.sleep(0.05)