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

Nicer errors from modules if arguments are not fed key=value

This commit is contained in:
Michael DeHaan 2012-08-08 20:30:20 -04:00
parent 183fce6d99
commit 2f6d6ccb5a

View file

@ -149,7 +149,10 @@ class AnsibleModule(object):
items = shlex.split(args)
params = {}
for x in items:
(k, v) = x.split("=",1)
try:
(k, v) = x.split("=",1)
except:
self.fail_json(msg="this module requires key=value arguments")
params[k] = v
return (params, args)