From be28443943b3781a0d2298c3ba05017ec4a99ed0 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 9 May 2016 08:14:08 -0700 Subject: [PATCH] Strip leading and trailing whitespace for json arg types --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index d8ab7a6b156..2190b3462f3 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1400,7 +1400,7 @@ class AnsibleModule(object): # Return a jsonified string. Sometimes the controller turns a json # string into a dict/list so transform it back into json here if isinstance(value, (unicode, bytes)): - return value + return value.strip() else: if isinstance(value (list, tuple, dict)): return json.dumps(value)