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

Strip leading and trailing whitespace for json arg types

This commit is contained in:
Toshio Kuratomi 2016-05-09 08:14:08 -07:00
parent 30e5999812
commit 409bfe4d0f

View file

@ -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)