Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!54Release 2.0.0
......@@ -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' ),
......
......@@ -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>
</config>
<encapsulation>
<config>
<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>
{% 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>
{% endif %}
{% if type=='L2VSI' %}
<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>
......@@ -35,8 +36,7 @@
<mac-aging-time>300</mac-aging-time>
</config>
</fdb>
{% endif %}
{% endif %}
{% endif %}
</network-instance>
</network-instances>
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