summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Dittmann <github@christoph-d.de>2015-12-02 10:54:28 +0100
committerJames Cammarata <jimi@sngx.net>2015-12-02 09:00:26 -0500
commit1f1febaa0df01c09ed278e8718b643b8a926e5ad (patch)
tree3dcdd69a5cad05d9dc0265dfb03d1aa856fa81b2
parent3c25ae2e105c3209676b6fdc89331ec3bcee904f (diff)
downloadansible-1f1febaa0df01c09ed278e8718b643b8a926e5ad.tar.gz
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.
-rw-r--r--lib/ansible/executor/play_iterator.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py
index fd59478ead..23ba52edf9 100644
--- a/lib/ansible/executor/play_iterator.py
+++ b/lib/ansible/executor/play_iterator.py
@@ -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)