Remove "legacy" code from PlayIterator (#53754)

pull/54353/head
Martin Krizek 6 years ago committed by GitHub
parent e02524dd58
commit 5ff1ce28d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save