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

fix action parsing to avoid conflicts agin

This commit is contained in:
Brian Coca 2016-08-26 16:15:55 -04:00
parent e4b0690ef3
commit f25ec5adb3

View file

@ -264,6 +264,8 @@ class ModuleArgsParser:
if 'action' in self._task_ds:
# an old school 'action' statement
thing = self._task_ds['action']
action, args = self._normalize_parameters(thing, action=action, additional_args=additional_args)
# local_action
if 'local_action' in self._task_ds:
@ -272,6 +274,7 @@ class ModuleArgsParser:
raise AnsibleParserError("action and local_action are mutually exclusive", obj=self._task_ds)
thing = self._task_ds.get('local_action', '')
delegate_to = 'localhost'
action, args = self._normalize_parameters(thing, action=action, additional_args=additional_args)
# module: <stuff> is the more new-style invocation
@ -283,10 +286,9 @@ class ModuleArgsParser:
raise AnsibleParserError("conflicting action statements", obj=self._task_ds)
action = item
thing = value
#TODO: find out if we should break here? Currently last matching action, break would make it first one
action, args = self._normalize_parameters(thing, action=action, additional_args=additional_args)
# if we didn't see any module in the task at all, it's not a task really
if action is None:
if 'ping' not in module_loader: