[elbe-devel] [PATCH 03/11] elbepack: delete unused function system_out_stderr

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed Mar 13 16:54:52 CET 2024


Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/shellhelper.py | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/elbepack/shellhelper.py b/elbepack/shellhelper.py
index 779cdc30ba4c..5abd3c078fa3 100644
--- a/elbepack/shellhelper.py
+++ b/elbepack/shellhelper.py
@@ -168,37 +168,6 @@ def command_out_stderr(cmd, stdin=None, env_add=None):
     return p.returncode, output, stderr
 
 
-def system_out_stderr(cmd, stdin=None, allow_fail=False, env_add=None):
-    """system_out_stderr() - Wrapper around command_out_stderr()
-
-    Throws CommandError if cmd failed and allow_fail=False.  Otherwise,
-    returns the stdout and stderr of cmd.
-
-    --
-
-    >>> system_out_stderr("false") # doctest: +ELLIPSIS
-    Traceback (most recent call last):
-    ...
-    elbepack.shellhelper.CommandError: ...
-
-    >>> system_out_stderr("cat - && false", allow_fail=True, stdin=b"ELBE")
-    ('ELBE', '')
-
-    >>> system_out_stderr("1>&2 cat -", allow_fail=True, stdin=b"ELBE")
-    ('', 'ELBE')
-
-    >>> system_out_stderr("1>&2 cat -", allow_fail=True, stdin="ELBE")
-    ('', 'ELBE')
-    """
-    code, out, err = command_out_stderr(cmd, stdin, env_add)
-
-    if code != 0:
-        if not allow_fail:
-            raise CommandError(cmd, code)
-
-    return out, err
-
-
 def do(cmd, allow_fail=False, stdin=None, env_add=None, log_cmd=None):
     """do() - Execute cmd in a shell and redirect outputs to logging.
 

-- 
2.44.0



More information about the elbe-devel mailing list