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

NBI - IETF L3VPN Connector:

- Fixed parsing of optional site routing protocols
parent 3a9555c0
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!172Resolve "(CTTC) Extend gNMI-OpenConfig SBI driver"
......@@ -195,11 +195,17 @@ def process_site(site : Dict, errors : List[Dict]) -> None:
# site_static_routing: (lan-range, lan-prefix-len, lan-tag) => next-hop
site_static_routing : Dict[Tuple[str, str], str] = {}
for rt_proto in site['routing-protocols']['routing-protocol']:
site_routing_protocols : Dict = site.get('routing-protocols', dict()).get('routing-protocol', list())
site_routing_protocol : List = site_routing_protocols.get('routing-protocol', list())
for rt_proto in site_routing_protocol:
if rt_proto['type'] != 'ietf-l3vpn-svc:static':
MSG = 'Site Routing Protocol Type: {:s}'
raise NotImplementedError(MSG.format(str(rt_proto['type'])))
for ipv4_rt in rt_proto['static']['cascaded-lan-prefixes']['ipv4-lan-prefixes']:
rt_proto_static : Dict = rt_proto.get('static', dict())
rt_proto_static_clps : Dict = rt_proto_static.get('cascaded-lan-prefixes', dict())
rt_proto_static_clps_v4 = rt_proto_static_clps.get('ipv4-lan-prefixes', list())
for ipv4_rt in rt_proto_static_clps_v4:
lan_range, lan_prefix = ipv4_rt['lan'].split('/')
lan_prefix = int(lan_prefix)
lan_tag = int(ipv4_rt['lan-tag'].replace('vlan', ''))
......
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