Skip to content
Snippets Groups Projects
Commit bfb5bcb7 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Service component - gNMI OpenConfig Service Handler:

- Corrected link composition in StaticRouteGenerator
parent 76292e00
No related branches found
No related tags found
3 merge requests!346Draft: support for restconf protocol,!345Draft: support ipinfusion devices via netconf,!299Resolve "(CTTC) Fix CI/CD pipeline end-to-end tests not passing"
......@@ -72,6 +72,15 @@ class StaticRouteGenerator:
added_connection_hops.add(connection_hop)
connection_hop_list = filtered_connection_hop_list
# In some cases connection_hop_list first and last items might be internal endpoints of
# devices instead of link endpoints. Filter those endpoints not reaching a new device.
if len(connection_hop_list) > 2 and connection_hop_list[0][0] == connection_hop_list[1][0]:
# same device on first 2 endpoints
connection_hop_list = connection_hop_list[1:]
if len(connection_hop_list) > 2 and connection_hop_list[-1][0] == connection_hop_list[-2][0]:
# same device on last 2 endpoints
connection_hop_list = connection_hop_list[:-1]
num_connection_hops = len(connection_hop_list)
if num_connection_hops % 2 != 0: raise Exception('Number of connection hops must be even')
if num_connection_hops < 4: raise Exception('Number of connection hops must be >= 4')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment