From 2f6d6ccb5aa2df9b95d591c48eec4cdddd024446 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 8 Aug 2012 20:30:20 -0400 Subject: [PATCH] Nicer errors from modules if arguments are not fed key=value --- lib/ansible/module_common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_common.py b/lib/ansible/module_common.py index e660ce2e6d..f49d243408 100644 --- a/lib/ansible/module_common.py +++ b/lib/ansible/module_common.py @@ -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)