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

Service component - L3NM OpenConfig:

- Correct order of config rules
- Correct attribute names
parent 137f5bed
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"
......@@ -107,7 +107,30 @@ def setup_config_rules(
'protocol_name': 'STATIC',
}),
#Create interface with subinterface
#Create interface with subinterface (without IP address)
json_config_rule_set(
'/interface[{:s}]/subinterface[{:d}]'.format(if_subif_name, sub_interface_index), {
'name' : if_subif_name,
'type' :'ethernetCsmacd',
'mtu' : mtu,
'index' : sub_interface_index,
'description': network_subinterface_desc,
'vlan_id' : vlan_id,
}),
#Associate interface to network instance
json_config_rule_set(
'/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), {
'name' : network_instance_name,
'type' : 'L3VRF',
'id' : if_subif_name,
'interface' : if_subif_name,
'subinterface' : sub_interface_index,
'address_ip' : address_ip,
'address_prefix': address_prefix,
}),
#Create interface with subinterface (with IP address)
json_config_rule_set(
'/interface[{:s}]/subinterface[{:d}]'.format(if_subif_name, sub_interface_index), {
'name' : if_subif_name,
......@@ -120,20 +143,10 @@ def setup_config_rules(
'address_prefix': address_prefix,
}),
#Associate interface to network instance
json_config_rule_set(
'/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), {
'name' : network_instance_name,
'id' : if_subif_name,
'interface' : if_subif_name,
'subinterface': sub_interface_index,
'address_ip' : address_ip,
'address_prefix': address_prefix,
}),
json_config_rule_set(
'/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, self_bgp_if_name), {
'name' : network_instance_name,
'type' : 'L3VRF',
'id' : self_bgp_if_name,
'interface' : self_bgp_if_name,
'subinterface': bgp_sub_interface_index,
......@@ -151,10 +164,9 @@ def setup_config_rules(
# pylint: disable=duplicate-string-formatting-argument
'/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format(policy_import, policy_import), {
'policy_name' : policy_import,
'statement_name' : 'stm_{:s}'.format(policy_import),
'statement_name' : 'stm_{:s}'.format(policy_import), # OCNOS: '10',
'ext_community_set_name': 'set_{:s}'.format(policy_import),
'policy_result' : 'ACCEPT_ROUTE',
'sequence_id' : '10'
}),
#Associate routing policy to network instance
......@@ -174,10 +186,9 @@ def setup_config_rules(
# pylint: disable=duplicate-string-formatting-argument
'/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format(policy_export, policy_export), {
'policy_name' : policy_export,
'statement_name' : 'stm_{:s}'.format(policy_export),
'statement_name' : 'stm_{:s}'.format(policy_export), # OCNOS: '10',
'ext_community_set_name': 'set_{:s}'.format(policy_export),
'policy_result' : 'ACCEPT_ROUTE',
'sequence_id' : '10'
}),
#Associate routing policy to network instance
......@@ -262,10 +273,9 @@ def teardown_config_rules(
# pylint: disable=duplicate-string-formatting-argument
'/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format(policy_export, policy_export), {
'policy_name' : policy_export,
'statement_name' : 'stm_{:s}'.format(policy_export),
'statement_name' : 'stm_{:s}'.format(policy_export), # OCNOS: '10',
'ext_community_set_name': 'set_{:s}'.format(policy_export),
'policy_result' : 'ACCEPT_ROUTE',
'sequence_id' : '10'
}),
json_config_rule_delete(
'/routing_policy/bgp_defined_set[{:s}_rt_export][{:s}]'.format(policy_export, route_distinguisher), {
......@@ -277,10 +287,9 @@ def teardown_config_rules(
# pylint: disable=duplicate-string-formatting-argument
'/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format(policy_import, policy_import), {
'policy_name' : policy_import,
'statement_name' : 'stm_{:s}'.format(policy_import),
'statement_name' : 'stm_{:s}'.format(policy_import), # OCNOS: '10',
'ext_community_set_name': 'set_{:s}'.format(policy_import),
'policy_result' : 'ACCEPT_ROUTE',
'sequence_id' : '10'
}),
json_config_rule_delete(
'/routing_policy/bgp_defined_set[{:s}_rt_import][{:s}]'.format(policy_import, route_distinguisher), {
......
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