Browse Source

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

tags/8.7.1
Zuul 2 weeks ago
parent
commit
8b6830f5bb
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      tripleo_common/actions/ansible.py

+ 2
- 4
tripleo_common/actions/ansible.py View File

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

Loading…
Cancel
Save