mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Error -> ParserError
This commit is contained in:
parent
79f41d9c1a
commit
98ed69213b
1 changed files with 5 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleParserError
|
||||||
from ansible.plugins import module_finder
|
from ansible.plugins import module_finder
|
||||||
from ansible.parsing.splitter import parse_kv
|
from ansible.parsing.splitter import parse_kv
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ class ModuleArgsParser(object):
|
||||||
|
|
||||||
# local_action is similar but also implies a delegate_to
|
# local_action is similar but also implies a delegate_to
|
||||||
if action is not None:
|
if action is not None:
|
||||||
raise AnsibleError("action and local_action are mutually exclusive")
|
raise AnsibleParserError("action and local_action are mutually exclusive", obj=self._task)
|
||||||
thing = ds.get('local_action', '')
|
thing = ds.get('local_action', '')
|
||||||
delegate_to = 'localhost'
|
delegate_to = 'localhost'
|
||||||
action, args = self._normalize_parameters(thing)
|
action, args = self._normalize_parameters(thing)
|
||||||
|
@ -219,14 +219,14 @@ class ModuleArgsParser(object):
|
||||||
|
|
||||||
# module: <stuff> is the more new-style invocation
|
# module: <stuff> is the more new-style invocation
|
||||||
if action is not None:
|
if action is not None:
|
||||||
raise AnsibleError("conflicting action statements")
|
raise AnsibleParserError("conflicting action statements", obj=self._task)
|
||||||
|
|
||||||
# walk the input dictionary to see we recognize a module name
|
# walk the input dictionary to see we recognize a module name
|
||||||
for (item, value) in ds.iteritems():
|
for (item, value) in ds.iteritems():
|
||||||
if item in module_finder:
|
if item in module_finder:
|
||||||
# finding more than one module name is a problem
|
# finding more than one module name is a problem
|
||||||
if action is not None:
|
if action is not None:
|
||||||
raise AnsibleError("conflicting action statements")
|
raise AnsibleParserError("conflicting action statements", obj=self._task)
|
||||||
action = item
|
action = item
|
||||||
thing = value
|
thing = value
|
||||||
action, args = self._normalize_parameters(value, action=action)
|
action, args = self._normalize_parameters(value, action=action)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue