Skip to content

Commit

Permalink
cli-pretty: only print stp state if oper status is up
Browse files Browse the repository at this point in the history
Only print bridge port stp state if operational status of the
interface is up.

Signed-off-by: Richard Alpe <richard@bit42.se>
  • Loading branch information
rical committed Feb 20, 2024
1 parent 128c053 commit 1f703e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions board/netconf/rootfs/libexec/infix/cli-pretty
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1f703e8

Please sign in to comment.