mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 04:53:01 +02:00
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 <richard@bit42.se>
This commit is contained in:
committed by
Joachim Wiberg
parent
6e9ba0fce5
commit
e3a2895531
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user