From 3f4ac0b9f774ade3cae66e46ac6ce1e23727706e Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 22 Nov 2016 11:03:19 -0500 Subject: [PATCH] Fix for whitespace padding on JSON responses Fixes #17825, closes #17829 --- lib/ansible/module_utils/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/shell.py b/lib/ansible/module_utils/shell.py index 2f30f58a06..9b096b249f 100644 --- a/lib/ansible/module_utils/shell.py +++ b/lib/ansible/module_utils/shell.py @@ -176,7 +176,7 @@ class Shell(object): def sanitize(self, cmd, resp): cleaned = [] for line in resp.splitlines(): - if line.startswith(str(cmd)) or self.find_prompt(line): + if line.lstrip().startswith(str(cmd)) or self.find_prompt(line): continue cleaned.append(line) return "\n".join(cleaned)