1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

removed changes to make local action equate connection=local and brought it back to equate delegate_to=localhost

This commit is contained in:
Brian Coca 2015-10-09 12:38:14 -04:00
parent bcb173996b
commit 101c8785ec
2 changed files with 10 additions and 14 deletions

View file

@ -233,9 +233,10 @@ class ModuleArgsParser:
task, dealing with all sorts of levels of fuzziness. task, dealing with all sorts of levels of fuzziness.
''' '''
thing = None thing = None
action = None action = None
connection = self._task_ds.get('connection', None) delegate_to = self._task_ds.get('delegate_to', None)
args = dict() args = dict()
@ -255,12 +256,11 @@ class ModuleArgsParser:
# local_action # local_action
local_action = False local_action = False
if 'local_action' in self._task_ds: if 'local_action' in self._task_ds:
# local_action is similar but also implies a connection='local' # local_action is similar but also implies a delegate_to
if action is not None: if action is not None:
raise AnsibleParserError("action and local_action are mutually exclusive", obj=self._task_ds) raise AnsibleParserError("action and local_action are mutually exclusive", obj=self._task_ds)
thing = self._task_ds.get('local_action', '') thing = self._task_ds.get('local_action', '')
connection = 'local' delegate_to = 'localhost'
local_action = True
action, args = self._normalize_parameters(thing, additional_args=additional_args) action, args = self._normalize_parameters(thing, additional_args=additional_args)
# walk the input dictionary to see we recognize a module name # walk the input dictionary to see we recognize a module name
@ -294,8 +294,4 @@ class ModuleArgsParser:
# shell modules require special handling # shell modules require special handling
(action, args) = self._handle_shell_weirdness(action, args) (action, args) = self._handle_shell_weirdness(action, args)
# now add the local action flag to the args, if it was set return (action, args, delegate_to)
if local_action:
args['_local_action'] = local_action
return (action, args, connection)

View file

@ -184,11 +184,11 @@ class Task(Base, Conditional, Taggable, Become):
# and the delegate_to value from the various possible forms # and the delegate_to value from the various possible forms
# supported as legacy # supported as legacy
args_parser = ModuleArgsParser(task_ds=ds) args_parser = ModuleArgsParser(task_ds=ds)
(action, args, connection) = args_parser.parse() (action, args, delegate_to) = args_parser.parse()
new_ds['action'] = action new_ds['action'] = action
new_ds['args'] = args new_ds['args'] = args
new_ds['connection'] = connection new_ds['delegate_to'] = delegate_to
# we handle any 'vars' specified in the ds here, as we may # we handle any 'vars' specified in the ds here, as we may
# be adding things to them below (special handling for includes). # be adding things to them below (special handling for includes).
@ -200,8 +200,8 @@ class Task(Base, Conditional, Taggable, Become):
else: else:
new_ds['vars'] = dict() new_ds['vars'] = dict()
for (k,v) in iteritems(ds): for (k,v) in ds.iteritems():
if k in ('action', 'local_action', 'args', 'connection') or k == action or k == 'shell': if k in ('action', 'local_action', 'args', 'delegate_to') or k == action or k == 'shell':
# we don't want to re-assign these values, which were # we don't want to re-assign these values, which were
# determined by the ModuleArgsParser() above # determined by the ModuleArgsParser() above
continue continue