From e3a2895531edffe65580f1a583afbf0ed2ecc168 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Mon, 11 Sep 2023 16:13:41 +0200 Subject: [PATCH] cli-pretty: print ip address origin (ip route proto) Print the origin which is based on info from ip route proto. Signed-off-by: Richard Alpe --- board/netconf/rootfs/lib/infix/cli-pretty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/board/netconf/rootfs/lib/infix/cli-pretty b/board/netconf/rootfs/lib/infix/cli-pretty index 9d2f6d70..0d5eb844 100755 --- a/board/netconf/rootfs/lib/infix/cli-pretty +++ b/board/netconf/rootfs/lib/infix/cli-pretty @@ -75,9 +75,11 @@ class Iface: def pr_proto_ipv4(self, pipe=''): for addr in self.ipv4_addr: + origin = f"({addr['origin']})" if addr.get('origin') else "" + row = f"{pipe:<{Pad.iface}}" row += f"{'ipv4':<{Pad.proto}}" - row += f"{'':<{Pad.state}}{addr['ip']}/{addr['prefix-length']}" + row += f"{'':<{Pad.state}}{addr['ip']}/{addr['prefix-length']} {origin}" print(row) def pr_proto_eth(self):