From 585766201d5eea9fa699f309e0dd3abf4cfff127 Mon Sep 17 00:00:00 2001 From: Richard C Isaacson Date: Wed, 26 Feb 2014 14:25:56 -0600 Subject: [PATCH] When looking for double colon len(line) is longer then 1. Addresses GH-5116. It comes up that when parsing json that if you are missing the last double quote on the last variable and the next line is just '}' we will get an out of range error. In this instance we will also then make sure that the line is long enough to have two colons. --- lib/ansible/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 6c6e19252be..cb056fdcfd2 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -375,7 +375,7 @@ It should be written as: """ return msg - elif len(probline) and len(probline) >= column and probline[column] == ":" and probline.count(':') > 1: + elif len(probline) and len(probline) > 1 and len(probline) >= column and probline[column] == ":" and probline.count(':') > 1: msg = msg + """ This one looks easy to fix. There seems to be an extra unquoted colon in the line and this is confusing the parser. It was only expecting to find one free