Commit 8aa26400 by Nathan A. Feger

Better error messaging in utils

When a command responds with json that is unparseable, dump that unpareseable response instead of swallowing it.
parent 9b7e7092
......@@ -182,7 +182,12 @@ def parse_json(data):
# not JSON, but try "Baby JSON" which allows many of our modules to not
# require JSON and makes writing modules in bash much simpler
results = {}
tokens = shlex.split(data)
try :
tokens = shlex.split(data)
except:
print "failed to parse json: "+ data
raise;
for t in tokens:
if t.find("=") == -1:
raise errors.AnsibleError("failed to parse: %s" % data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment