osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29433 )
Change subject: obs: lib.run_cmd: set stdin to subprocess.DEVNULL ......................................................................
obs: lib.run_cmd: set stdin to subprocess.DEVNULL
Don't pass stdin to the programs, as we expect them to run non-interactively and also don't show the program's output unless -v is used or the exit code is not 0.
Change-Id: I7e893101c2a3e7b005659ec72aa44fa932b7ccd9 --- M scripts/obs/lib/__init__.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index 58fe0e4..1ed5ef5 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -119,9 +119,9 @@ print(f"+ {caller}(): {cmd}")
with tempfile.TemporaryFile(encoding="utf8", mode="w+") as output_buf: - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, text=True, bufsize=1, - *args, **kwargs) + p = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + text=True, bufsize=1, *args, **kwargs)
while True: out = p.stdout.read(1)