mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 07:24:00 -07:00
Revert "Track local_action internally to prevent it from being overridden"
This reverts commit 49ca0eb797
.
This commit is contained in:
parent
101c8785ec
commit
abf2e13955
3 changed files with 6 additions and 22 deletions
|
@ -95,10 +95,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
self._role = role
|
||||
self._task_include = task_include
|
||||
|
||||
# special flag for local_action: tasks, to make sure their
|
||||
# connection type of local isn't overridden incorrectly
|
||||
self._local_action = False
|
||||
|
||||
super(Task, self).__init__()
|
||||
|
||||
def get_path(self):
|
||||
|
@ -140,16 +136,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
t = Task(block=block, role=role, task_include=task_include)
|
||||
return t.load_data(data, variable_manager=variable_manager, loader=loader)
|
||||
|
||||
def load_data(self, ds, variable_manager=None, loader=None):
|
||||
'''
|
||||
We override load_data for tasks so that we can pull special flags
|
||||
out of the task args and set them internaly only so the user never
|
||||
sees them.
|
||||
'''
|
||||
t = super(Task, self).load_data(ds=ds, variable_manager=variable_manager, loader=loader)
|
||||
t._local_action = t.args.pop('_local_action', False)
|
||||
return t
|
||||
|
||||
def __repr__(self):
|
||||
''' returns a human readable representation of the task '''
|
||||
return "TASK: %s" % self.get_name()
|
||||
|
@ -280,7 +266,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
|
||||
def copy(self, exclude_block=False):
|
||||
new_me = super(Task, self).copy()
|
||||
new_me._local_action = self._local_action
|
||||
|
||||
new_me._block = None
|
||||
if self._block and not exclude_block:
|
||||
|
@ -298,7 +283,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
|
||||
def serialize(self):
|
||||
data = super(Task, self).serialize()
|
||||
data['_local_action'] = self._local_action
|
||||
|
||||
if self._block:
|
||||
data['block'] = self._block.serialize()
|
||||
|
@ -317,7 +301,6 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
#from ansible.playbook.task_include import TaskInclude
|
||||
|
||||
block_data = data.get('block')
|
||||
self._local_action = data.get('_local_action', False)
|
||||
|
||||
if block_data:
|
||||
b = Block()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue