mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 23:43:20 +02:00
cli-pretty: use self variables for ipv4 address
Cosmetic code cleanup. Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
committed by
Joachim Wiberg
parent
669379818e
commit
6e9ba0fce5
@@ -74,12 +74,7 @@ class Iface:
|
||||
|
||||
|
||||
def pr_proto_ipv4(self, pipe=''):
|
||||
addr = self.data.get("ietf-ip:ipv4")
|
||||
if not addr:
|
||||
return
|
||||
|
||||
addresses = self.data.get("ietf-ip:ipv4", {}).get("address", [])
|
||||
for addr in addresses:
|
||||
for addr in self.ipv4_addr:
|
||||
row = f"{pipe:<{Pad.iface}}"
|
||||
row += f"{'ipv4':<{Pad.proto}}"
|
||||
row += f"{'':<{Pad.state}}{addr['ip']}/{addr['prefix-length']}"
|
||||
|
||||
Reference in New Issue
Block a user