Merge "Don't accumulate ansible output uselessly" into stable/queens

This commit is contained in:
Zuul 2019-08-31 01:55:21 +00:00 committed by Gerrit Code Review
commit 8b6830f5bb
1 changed files with 2 additions and 4 deletions

View File

@ -520,7 +520,8 @@ class AnsiblePlaybookAction(base.TripleOAction):
lines = []
for line in iter(process.stdout.readline, b''):
lines.append(line)
stdout.append(line)
if not self.trash_output:
stdout.append(line)
if time.time() - start > 30:
self.post_message(queue, ''.join(lines))
lines = []
@ -532,9 +533,6 @@ class AnsiblePlaybookAction(base.TripleOAction):
# stdout we don't know the difference. To keep the return dict
# similar there is an empty stderr. We can use the return code
# to determine if there was an error.
if self.trash_output:
stdout = []
stderr = ""
return {"stdout": "".join(stdout), "returncode": returncode,
"stderr": ""}