Fix for internal routes via unselected hosts
This commit is contained in:
parent
cfaf39bac7
commit
49ab7b003b
13
lg.py
13
lg.py
@ -688,7 +688,9 @@ def show_route(request_type, hosts, proto):
|
|||||||
|
|
||||||
detail = {}
|
detail = {}
|
||||||
errors = []
|
errors = []
|
||||||
for host in hosts.split("+"):
|
hosts = hosts.split("+")
|
||||||
|
allhosts = hosts[:]
|
||||||
|
for host in allhosts:
|
||||||
ret, res = bird_command(host, proto, command)
|
ret, res = bird_command(host, proto, command)
|
||||||
res = res.split("\n")
|
res = res.split("\n")
|
||||||
|
|
||||||
@ -702,6 +704,15 @@ def show_route(request_type, hosts, proto):
|
|||||||
|
|
||||||
if bgpmap:
|
if bgpmap:
|
||||||
detail[host] = build_as_tree_from_raw_bird_ouput(host, proto, res)
|
detail[host] = build_as_tree_from_raw_bird_ouput(host, proto, res)
|
||||||
|
#for internal routes via hosts not selected
|
||||||
|
#add them to the list, but only show preferred route
|
||||||
|
if host not in hosts:
|
||||||
|
detail[host] = detail[host][:1]
|
||||||
|
for path in detail[host]:
|
||||||
|
if len(path) == 2:
|
||||||
|
if (path[1] not in allhosts) and (path[1] in app.config["PROXY"]):
|
||||||
|
allhosts.append(path[1])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
detail[host] = add_links(res)
|
detail[host] = add_links(res)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user