diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 861053da20d..6da1f9a0301 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -1129,11 +1129,10 @@ def filter_leading_non_json_lines(buf): filter only leading lines since multiline JSON is valid. ''' - kv_regex = re.compile(r'\w=\w') filtered_lines = StringIO.StringIO() stop_filtering = False for line in buf.splitlines(): - if stop_filtering or line.startswith('{') or line.startswith('[') or kv_regex.search(line): + if stop_filtering or line.startswith('{') or line.startswith('['): stop_filtering = True filtered_lines.write(line + '\n') return filtered_lines.getvalue() diff --git a/test/units/TestUtils.py b/test/units/TestUtils.py index 58535f0488f..73ef9796743 100644 --- a/test/units/TestUtils.py +++ b/test/units/TestUtils.py @@ -453,8 +453,6 @@ class TestUtils(unittest.TestCase): '{"foo": "bar"}\n') self.assertEqual(ansible.utils.filter_leading_non_json_lines('a\nb\nansible!\n["foo", "bar"]'), '["foo", "bar"]\n') - self.assertEqual(ansible.utils.filter_leading_non_json_lines('a\nb\nansible!\nfoo=bar'), - 'foo=bar\n') def test_boolean(self): self.assertEqual(ansible.utils.boolean("true"), True)