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.
epel8
Maxwell G 2 years ago
parent 5e5c534c32
commit e3d150ec90
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

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

Loading…
Cancel
Save