From b503afe67b7b3c8d3c550658d77500c4a0a62098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 8 Jan 2024 15:05:18 +0100 Subject: [PATCH] Fix regression after 35d74cecd4 Show normal next-hops also, not only next-hop-list routes --- board/netconf/rootfs/libexec/infix/cli-pretty | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/board/netconf/rootfs/libexec/infix/cli-pretty b/board/netconf/rootfs/libexec/infix/cli-pretty index 970fa6d1..0b6f914c 100755 --- a/board/netconf/rootfs/libexec/infix/cli-pretty +++ b/board/netconf/rootfs/libexec/infix/cli-pretty @@ -74,17 +74,15 @@ class Route: interface = get_json_data(None, self.data, 'next-hop', 'outgoing-interface') address = get_json_data(None, self.data, 'next-hop', f'ietf-{ip}-unicast-routing:next-hop-address') special = get_json_data(None, self.data, 'next-hop', 'special-next-hop') - nh = "" - if interface: - self.nh = interface - elif address: - self.nh = address - elif special: - self.nh = special - else: - self.nh = "unspecified" - self.next_hop.append(nh) + if address: + self.next_hop.append(address) + elif interface: + self.next_hop.append(interface) + elif special: + self.next_hop.append(special) + else: + self.next_hop.append("unspecified") def print(self): row = f"{self.prefix:<{PadRoute.prefix}}" row += f"{self.next_hop[0]:<{PadRoute.next_hop}}"