Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!196Resolve "(CTTC) Incorrect endpoint lookup in NBI ETSI BWM plugin"
...@@ -65,8 +65,10 @@ def create_If_SubIf(data,vendor, DEL): ...@@ -65,8 +65,10 @@ def create_If_SubIf(data,vendor, DEL):
with tag('single-tagged'): with tag('single-tagged'):
with tag('config'): with tag('config'):
with tag('vlan-id'):text(data['vlan_id']) 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"): 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('addresses'):
with tag('address'): with tag('address'):
with tag('ip'):text(data['address_ip']) with tag('ip'):text(data['address_ip'])
......
...@@ -196,7 +196,7 @@ def associate_If_to_NI(parameters, DEL): ...@@ -196,7 +196,7 @@ def associate_If_to_NI(parameters, DEL):
with tag('name'):text(parameters['name']) with tag('name'):text(parameters['name'])
with tag('config'): with tag('config'):
with tag('name'):text(parameters['name']) 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('interfaces'):
with tag('interface'): with tag('interface'):
with tag('id'):text(parameters['id']) with tag('id'):text(parameters['id'])
...@@ -204,25 +204,7 @@ def associate_If_to_NI(parameters, DEL): ...@@ -204,25 +204,7 @@ def associate_If_to_NI(parameters, DEL):
with tag('id') :text(parameters['id']) with tag('id') :text(parameters['id'])
with tag('interface') :text(parameters['interface']) with tag('interface') :text(parameters['interface'])
with tag('subinterface'):text(parameters['subinterface']) 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( result = indent(
doc.getvalue(), doc.getvalue(),
...@@ -365,7 +347,8 @@ def create_table_conns(parameters,DEL): ...@@ -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('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('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('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: if len(parameters['default_import_policy']) != 0:
with tag('default-import-policy'):text(parameters['default_import_policy']) with tag('default-import-policy'):text(parameters['default_import_policy'])
result = indent( result = indent(
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
<src-protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{src_protocol}}</src-protocol> <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> <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> <address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:{{address_family}}</address-family>
<dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">{{as}}</dst-instance> {% 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 %} {% if default_import_policy is defined %}<default-import-policy>{{default_import_policy}}</default-import-policy>{% endif %}
</config> </config>
{% endif %} {% endif %}
......
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