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.
pull/13394/head
Christoph Dittmann 9 years ago
parent f78e27b082
commit 9a6ae1d62a

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

Loading…
Cancel
Save