osmith has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/33/29433/1
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index f2790d0..d494fc6 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -117,9 +117,9 @@ print(f"+ {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)