cli-pretty: use self variables for ipv4 address

Cosmetic code cleanup.

Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
Richard Alpe
2023-09-19 11:56:14 +02:00
committed by Joachim Wiberg
parent 669379818e
commit 6e9ba0fce5
+1 -6
View File
@@ -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']}"