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

Throw an error if multiple actions have been specified

This commit is contained in:
Daniel Hokka Zakrisson 2012-11-26 22:42:44 +01:00
parent 1e0295c7e2
commit 43bdec8b20

View file

@ -45,6 +45,8 @@ class Task(object):
# code to allow for saying "modulename: args" versus "action: modulename args"
if x in utils.plugins.module_finder:
if 'action' in ds:
raise errors.AnsibleError("multiple actions specified in task %s" % (ds.get('name', ds['action'])))
ds['action'] = x + " " + ds[x]
ds.pop(x)