Notification time stamped 2022-09-30 21:08:43 UTC
From e3d150ec904179fd2d529763491692ee3b192c44 Mon Sep 17 00:00:00 2001
From: Maxwell G <gotmax(a)e.email>
Date: Sep 30 2022 20:14:22 +0000
Subject: Flush stdout before subprocess.run
This commit adds sys.stdout.flush() before subprocess.run() in
ansible_collection.py. Without this, the print statements are shown
after the command output when building in mock.
---
diff --git a/ansible_collection.py b/ansible_collection.py
index 17c6777..70093be 100755
--- a/ansible_collection.py
+++ b/ansible_collection.py
@@ -70,6 +70,9 @@ class AnsibleCollection:
)
print(f"Running: {args}")
print()
+ # Without this, the print statements are shown after the command
+ # output when building in mock.
+ sys.stdout.flush()
subprocess.run(args, check=True, cwd=self.collection_srcdir)
print()
@@ -90,6 +93,9 @@ class AnsibleCollection:
args = ("ansible-test", "units", *extra_args)
print(f"Running: {args}")
print()
+ # Without this, the print statements are shown after the command
+ # output when building in mock.
+ sys.stdout.flush()
subprocess.run(args, cwd=temppath, check=True)
https://src.fedoraproject.org/rpms/ansible-packaging/c/e3d150ec904179fd2d...