From: Michael Tremer Date: Sat, 25 Feb 2023 12:16:05 +0000 (+0000) Subject: commands: Don't process output if the command failed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e472ff51ad59b9efe58dacc08756115de034b82f;p=people%2Fms%2Fbricklayer.git commands: Don't process output if the command failed We don't want any error messages to be returned here. Signed-off-by: Michael Tremer --- diff --git a/src/python/__init__.py b/src/python/__init__.py index b57d60f..4d367b9 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -278,8 +278,12 @@ class Bricklayer(object): if bind: self._unbind(bind) + # Skip any output processing on error + if p.returncode and error_ok: + return + # Check the return code (raises CalledProcessError on non-zero) - if not error_ok: + elif not error_ok: p.check_returncode() # There is no output in interactive mode