From 1f703e8cb80f497f7031da68c88bcff42b486349 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 20 Feb 2024 11:29:53 +0100 Subject: [PATCH] cli-pretty: only print stp state if oper status is up Only print bridge port stp state if operational status of the interface is up. Signed-off-by: Richard Alpe --- board/netconf/rootfs/libexec/infix/cli-pretty | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/netconf/rootfs/libexec/infix/cli-pretty b/board/netconf/rootfs/libexec/infix/cli-pretty index c0db5b5e9..20b598cd1 100755 --- a/board/netconf/rootfs/libexec/infix/cli-pretty +++ b/board/netconf/rootfs/libexec/infix/cli-pretty @@ -217,11 +217,11 @@ class Iface: row = f"{'bridge':<{Pad.proto}}" - if self.oper_status == "down": - row += Decore.red(f"{'DOWN':<{Pad.state}}") - else: + if self.oper_status == "up": dec = Decore.green if self.stp_state == "forwarding" else Decore.yellow row += dec(f"{self.stp_state.upper():<{Pad.state}}") + else: + row += Decore.red(f"{self.oper_status.upper():<{Pad.state}}") for vlan in br_vlans: if 'tagged' in vlan: