Fix for whitespace padding on JSON responses

Fixes #17825, closes #17829
This commit is contained in:
Nathaniel Case 2016-11-22 11:03:19 -05:00
parent 25aa757e80
commit 3f4ac0b9f7

View file

@ -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)