From fe6b32d3e31a94d5e2156bcf2273e42a172b90a1 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 30 Jun 2026 17:15:37 +0200 Subject: vyos.utils: T8981: catch_broken_pipe() decorator must return func(*args, **kwargs) "show system commit diff " produces no output (exit 0) for any revision, regardless of how much the revisions differ. The revision store and diff engine are intact - "show system commit file " works, and so does ConfigMgmt().compare(rev1=0, rev2=1) which returns the correct diff when called directly. Commit a29d73d00 ("op-mode: T8362: "compare" command lacks catch_broken_pipe decorator") added @catch_broken_pipe to ConfigMgmt.show_commit_diff to suppress BrokenPipeError tracebacks when piping output, but the decorator calls the wrapped function without returning its value. Thus the op-mode framework will receive None and prints nothing. --- python/vyos/utils/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/vyos/utils/io.py b/python/vyos/utils/io.py index 3efb55ddc..77e30cbb0 100644 --- a/python/vyos/utils/io.py +++ b/python/vyos/utils/io.py @@ -117,7 +117,7 @@ def catch_broken_pipe(func): import sys def wrapped(*args, **kwargs): try: - func(*args, **kwargs) + return func(*args, **kwargs) except (BrokenPipeError, KeyboardInterrupt): # Flush output to /dev/null and bail out. os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno()) # pylint: disable = no-member -- cgit v1.2.3