]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
commands: Don't process output if the command failed
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Feb 2023 12:16:05 +0000 (12:16 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Feb 2023 12:16:05 +0000 (12:16 +0000)
We don't want any error messages to be returned here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/__init__.py

index b57d60f43173125ce994b4864d6cd8ed1427cf47..4d367b9539ba084c3f5170c05261becd0edf1559 100644 (file)
@@ -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