From 5bb5082ed94b2bb5a1d037264f1dc0742e159fc0 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 16 Aug 2012 21:47:17 -0400 Subject: [PATCH] Fix failed to parse message handling --- lib/ansible/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 831c6ae0fc..be66883889 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -138,7 +138,7 @@ def parse_json(raw_data): for t in tokens: if t.find("=") == -1: - raise errors.AnsibleError("failed to parse: %s" % data) + raise errors.AnsibleError("failed to parse: %s" % raw_data) (key,value) = t.split("=", 1) if key == 'changed' or 'failed': if value.lower() in [ 'true', '1' ]: @@ -149,7 +149,7 @@ def parse_json(raw_data): value = int(value) results[key] = value if len(results.keys()) == 0: - return { "failed" : True, "parsed" : False, "msg" : data } + return { "failed" : True, "parsed" : False, "msg" : raw_data } return results _LISTRE = re.compile(r"(\w+)\[(\d+)\]")