Skip to content
Snippets Groups Projects
Commit db0c5aad authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component - OpenConfig driver:

- Fixes in per-vendor specificities
- Cosmetic improvements
parent 4580bbff
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"
......@@ -61,8 +61,8 @@ def generate_templates(resource_key: str, resource_value: str, delete: bool,vend
elif "inter_instance_policies" in resource_key:
result_templates.append(associate_RP_to_NI(data))
elif "protocols" in resource_key:
result_templates.append(add_protocol_NI(data, vendor, delete))
# if vendor == "ADVA": result_templates.append(add_protocol_NI(data, vendor, delete))
if vendor is None or vendor == "ADVA":
result_templates.append(add_protocol_NI(data, vendor, delete))
elif "table_connections" in resource_key:
result_templates.append(create_table_conns(data, delete))
elif "interface" in resource_key:
......
......@@ -121,7 +121,8 @@ def compose_config( # template generation
templates.append(JINJA_ENV.get_template('acl/acl-set/acl-entry/edit_config.xml'))
templates.append(JINJA_ENV.get_template('acl/interfaces/ingress/edit_config.xml'))
data : Dict[str, Any] = json.loads(resource_value)
operation = 'delete' if delete else ''
operation = 'delete' if delete else 'merge' # others
#operation = 'delete' if delete else '' # ipinfusion?
return [
'<config>{:s}</config>'.format(
......
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}>
<network-instance{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}>
<name>{{name}}</name>
{% if operation is not defined or operation != 'delete' %}
<config>
......
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