Let PlayIterator.add_tasks accept empty task lists

PlayIterator.add_tasks raised an error when trying to add an empty task
list.  This was the root cause of ansible issue #13370.
This commit is contained in:
Christoph Dittmann 2015-12-02 10:54:28 +01:00
parent f78e27b082
commit 9a6ae1d62a

View file

@ -399,6 +399,9 @@ class PlayIterator:
if state.fail_state != self.FAILED_NONE:
return state
if not task_list:
return state
if state.run_state == self.ITERATING_TASKS:
if state.tasks_child_state:
state.tasks_child_state = self._insert_tasks_into_state(state.tasks_child_state, task_list)