Commit e23652b7 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI component - IETF L2VPN connector:

- Added logic to auto-infer eth-inf-type field when possible
parent ee63f2f8
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -117,6 +117,14 @@ def process_site_network_access(
        encapsulation_type = network_access_connection.get('encapsulation-type', 'ietf-l2vpn-svc:ethernet')
        encapsulation_type = encapsulation_type.replace('ietf-l2vpn-svc:', '')

        eth_inf_type = None
        if 'eth-inf-type' not in network_access_connection:
            if 'tagged-interface' in network_access_connection:
                if encapsulation_type == 'ethernet':
                    eth_inf_type = 'untagged'
                elif encapsulation_type == 'vlan':
                    eth_inf_type == 'tagged'
        if eth_inf_type is None:
            eth_inf_type = network_access_connection.get('eth-inf-type', 'ietf-l2vpn-svc:untagged')
            eth_inf_type = eth_inf_type.replace('ietf-l2vpn-svc:', '')