Moving ConnectionInformation -> PlayContext

Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation

Fixes #11381
This commit is contained in:
James Cammarata 2015-07-21 12:12:22 -04:00
commit e64989beb4
36 changed files with 477 additions and 459 deletions

View file

@ -89,12 +89,12 @@ class PlayIterator:
FAILED_RESCUE = 4
FAILED_ALWAYS = 8
def __init__(self, inventory, play, connection_info, all_vars):
def __init__(self, inventory, play, play_context, all_vars):
self._play = play
self._blocks = []
for block in self._play.compile():
new_block = block.filter_tagged_tasks(connection_info, all_vars)
new_block = block.filter_tagged_tasks(play_context, all_vars)
if new_block.has_tasks():
self._blocks.append(new_block)
@ -103,12 +103,12 @@ class PlayIterator:
self._host_states[host.name] = HostState(blocks=self._blocks)
# if we're looking to start at a specific task, iterate through
# the tasks for this host until we find the specified task
if connection_info.start_at_task is not None:
if play_context.start_at_task is not None:
while True:
(s, task) = self.get_next_task_for_host(host, peek=True)
if s.run_state == self.ITERATING_COMPLETE:
break
if task.get_name() != connection_info.start_at_task:
if task.get_name() != play_context.start_at_task:
self.get_next_task_for_host(host)
else:
break