mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-02 05:43:02 +02:00
Fix regression after 35d74cecd4
Show normal next-hops also, not only next-hop-list routes
This commit is contained in:
committed by
Joachim Wiberg
parent
7cce19d45c
commit
b503afe67b
@@ -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}}"
|
||||
|
||||
Reference in New Issue
Block a user