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 <richard@bit42.se>
This commit is contained in:
Richard Alpe
2024-02-20 21:43:48 +01:00
committed by Tobias Waldekranz
parent 1827b65182
commit 0cb1459f43
@@ -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: