mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Restore "skipping: no hosts matched" message
In 159aa26b36
the result of _get_serialized_branches when no hosts were matched
changed from [[]] to []. Thus, the v2_playbook_on_no_hosts_matched
callback would not fire. Change the check so we get the error message
again. Fixes #17706
This commit is contained in:
parent
1293ec85dd
commit
1b8c2a2b0b
1 changed files with 5 additions and 6 deletions
|
@ -142,12 +142,11 @@ class PlaybookExecutor:
|
|||
|
||||
break_play = False
|
||||
# we are actually running plays
|
||||
for batch in self._get_serialized_batches(new_play):
|
||||
if len(batch) == 0:
|
||||
self._tqm.send_callback('v2_playbook_on_play_start', new_play)
|
||||
self._tqm.send_callback('v2_playbook_on_no_hosts_matched')
|
||||
break
|
||||
|
||||
batches = self._get_serialized_batches(new_play)
|
||||
if len(batches) == 0:
|
||||
self._tqm.send_callback('v2_playbook_on_play_start', new_play)
|
||||
self._tqm.send_callback('v2_playbook_on_no_hosts_matched')
|
||||
for batch in batches:
|
||||
# restrict the inventory to the hosts in the serialized batch
|
||||
self._inventory.restrict_to_hosts(batch)
|
||||
# and run it...
|
||||
|
|
Loading…
Reference in a new issue