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

Device component:

OpenConfig Driver:
- added default endpoint type in case it cannot be retrieved from the remote device
- corrected network_instance/edit_config.xml template; wrong XML format
parent 7a2ce809
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]:
        component_type = xml_component.find(
            'ocpp:port/ocpp:breakout-mode/ocpp:state/ocpp:channel-speed', namespaces=NAMESPACES)
        add_value_from_tag(endpoint, 'type', component_type)
        if 'type' not in endpoint: endpoint['type'] = '-'

        sample_types = {
            ORM_KpiSampleTypeEnum.BYTES_RECEIVED.value     : XPATH_IFACE_COUNTER.format(endpoint['uuid'], 'in-octets' ),
+13 −13
Original line number Diff line number Diff line
@@ -5,29 +5,30 @@
        <config>
            <name>{{name}}</name>
            <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type>
            {% if type=='L3VRF' %}
            {% if description is defined %}<description>{{description}}</description>{% endif %}
            <enabled>true</enabled>
            {% if type=='L3VRF' %}
            {% if router_id is defined %}<router-id>{{router_id}}</router-id>{% endif %}
            <route-distinguisher>{{route_distinguisher}}</route-distinguisher>
            <enabled>true</enabled>
            {% endif %}
            {% if type=='L2VSI' %}
            <mtu>1500</mtu>
            {% endif %}
        </config>
        {% if type=='L3VRF' or type=='L2VSI' %}
        <encapsulation>
            <config>
                {% if type=='L3VRF' %}
                <encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type>
                <label-allocation-mode xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:INSTANCE_LABEL</label-allocation-mode>
            </config>
        </encapsulation>
                {% endif %}
                {% if type=='L2VSI' %}
            {% if description is defined %}<description>{{description}}</description>{% endif %}
            <enabled>true</enabled>
            <mtu>1500</mtu>
        </config>
        <encapsulation>
            <config>
                <encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type>
                {% endif %}
            </config>
        </encapsulation>
        {% endif %}
        {% if type=='L2VSI' %}
        <fdb>
            <config>
                <mac-learning>true</mac-learning>
@@ -36,7 +37,6 @@
            </config>
        </fdb>
        {% endif %}

        {% endif %}
    </network-instance>
</network-instances>