summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2019-03-25 16:32:27 +0100
committerGitHub <noreply@github.com>2019-03-25 16:32:27 +0100
commit5ff1ce28d4f8af34bc5d60cf9d82ea4959407875 (patch)
tree4f60a3a379198238fe444252217193be7f6628e9
parente02524dd583978f30f4287620b04f88456e27dda (diff)
downloadansible-5ff1ce28d4f8af34bc5d60cf9d82ea4959407875.tar.gz
Remove "legacy" code from PlayIterator (#53754)
-rw-r--r--lib/ansible/executor/play_iterator.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py
index 51615ff618..0fdcb2fedc 100644
--- a/lib/ansible/executor/play_iterator.py
+++ b/lib/ansible/executor/play_iterator.py
@@ -305,7 +305,9 @@ class PlayIterator:
state.cur_regular_task = 0
state.cur_rescue_task = 0
state.cur_always_task = 0
- state.child_state = None
+ state.tasks_child_state = None
+ state.rescue_child_state = None
+ state.always_child_state = None
elif state.run_state == self.ITERATING_TASKS:
# clear the pending setup flag, since we're past that and it didn't fail
@@ -342,7 +344,7 @@ class PlayIterator:
task = block.block[state.cur_regular_task]
# if the current task is actually a child block, create a child
# state for us to recurse into on the next pass
- if isinstance(task, Block) or state.tasks_child_state is not None:
+ if isinstance(task, Block):
state.tasks_child_state = HostState(blocks=[task])
state.tasks_child_state.run_state = self.ITERATING_TASKS
# since we've created the child state, clear the task
@@ -375,7 +377,7 @@ class PlayIterator:
state.did_rescue = True
else:
task = block.rescue[state.cur_rescue_task]
- if isinstance(task, Block) or state.rescue_child_state is not None:
+ if isinstance(task, Block):
state.rescue_child_state = HostState(blocks=[task])
state.rescue_child_state.run_state = self.ITERATING_TASKS
task = None
@@ -416,7 +418,7 @@ class PlayIterator:
block._role._completed[host.name] = True
else:
task = block.always[state.cur_always_task]
- if isinstance(task, Block) or state.always_child_state is not None:
+ if isinstance(task, Block):
state.always_child_state = HostState(blocks=[task])
state.always_child_state.run_state = self.ITERATING_TASKS
task = None