From 3cc9bc3ceb19a2fb50cdb6e721dd686b54f3f795 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 9 Apr 2025 16:09:17 +0200 Subject: [PATCH] avoid initial runs to show acmetool not found errors --- cmdeploy/src/cmdeploy/remote/rshell.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmdeploy/src/cmdeploy/remote/rshell.py b/cmdeploy/src/cmdeploy/remote/rshell.py index a07f539b..042c5bf2 100644 --- a/cmdeploy/src/cmdeploy/remote/rshell.py +++ b/cmdeploy/src/cmdeploy/remote/rshell.py @@ -1,10 +1,13 @@ -from subprocess import CalledProcessError, check_output +from subprocess import DEVNULL, CalledProcessError, check_output def shell(command, fail_ok=False): print(f"$ {command}") + args = dict(shell=True) + if fail_ok: + args["stderr"] = DEVNULL try: - return check_output(command, shell=True).decode().rstrip() + return check_output(command, **args).decode().rstrip() except CalledProcessError: if not fail_ok: raise