Commit 5643f06b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component - OpenConfig driver:

- Disabled IPInfusion custom fields in table connections
- Corrected interface handling messages
parent 4f61e941
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -65,8 +65,10 @@ def create_If_SubIf(data,vendor, DEL):
                                with tag('single-tagged'):
                                    with tag('config'):
                                        with tag('vlan-id'):text(data['vlan_id'])
                        if "l3ipvlan" in data['type']: 
                        if "l3ipvlan" in data['type'] and 'address_ip' in data: 
                            with tag('ipv4',  xmlns="http://openconfig.net/yang/interfaces/ip"):
                                if 'mtu' in data:
                                    with tag('mtu'):text(data['mtu'])
                                with tag('addresses'):
                                    with tag('address'):
                                        with tag('ip'):text(data['address_ip'])
+4 −21
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ def associate_If_to_NI(parameters, DEL):
                with tag('name'):text(parameters['name'])
                with tag('config'):
                    with tag('name'):text(parameters['name'])
                    with tag('type', 'xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types"'):text('oc-ni-types:L3VRF')
                    with tag('type', 'xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types"'):text('oc-ni-types:',parameters['type'])
                with tag('interfaces'):
                    with tag('interface'):
                        with tag('id'):text(parameters['id'])
@@ -204,25 +204,7 @@ def associate_If_to_NI(parameters, DEL):
                            with tag('id')          :text(parameters['id'])
                            with tag('interface')   :text(parameters['interface'])
                            with tag('subinterface'):text(parameters['subinterface'])
    with tag('interfaces', 'xmlns="http://openconfig.net/yang/interfaces"'):
        with tag('interface'):
            with tag('name'):text(parameters['interface'])
            with tag('config'):
                with tag('name'):text(parameters['interface'])
            with tag('subinterfaces'):
                with tag('subinterface'):
                    with tag('index'): text(parameters['subinterface'])
                    with tag('config'):
                        with tag('index'): text(parameters['subinterface'])
                    with tag('ipv4',  'xmlns="http://openconfig.net/yang/interfaces/ip"'):
                        with tag('config'):
                            with tag('mtu'): text('1500')
                        with tag('addresses'):
                            with tag('address'):
                                with tag('ip'):text(parameters['address_ip'])
                                with tag('config'):
                                    with tag('ip'):text(parameters['address_ip'])
                                    with tag('prefix-length'):text(parameters['address_prefix'])

                            
    result = indent(
        doc.getvalue(),
@@ -365,7 +347,8 @@ def create_table_conns(parameters,DEL):
                        with tag('src-protocol','xmlns:oc-pol-types="http://openconfig.net/yang/policy-types"'):   text('oc-pol-types:',parameters['src_protocol'])
                        with tag('dst-protocol','xmlns:oc-pol-types="http://openconfig.net/yang/policy-types"'):   text('oc-pol-types:',parameters['dst_protocol'])
                        with tag('address-family', 'xmlns:oc-types="http://openconfig.net/yang/openconfig-types"'):text('oc-types:',parameters['address_family'])    
                        with tag('dst-instance', 'xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments"'):text('65000')
                        # for OCNOS: check if needed
                        #with tag('dst-instance', 'xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments"'):text('65000')
                        if len(parameters['default_import_policy']) != 0:
                            with tag('default-import-policy'):text(parameters['default_import_policy'])
    result = indent(
+3 −1
Original line number Diff line number Diff line
@@ -11,7 +11,9 @@
                    <src-protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{src_protocol}}</src-protocol>
                    <dst-protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{dst_protocol}}</dst-protocol>
                    <address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:{{address_family}}</address-family>
                    {% if False %}
                        <dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">{{as}}</dst-instance>
                    {% endif %}
                    {% if default_import_policy is defined %}<default-import-policy>{{default_import_policy}}</default-import-policy>{% endif %}
                </config>
                {% endif %}