Skip to content
Snippets Groups Projects
Commit 3874e897 authored by Shayan Hajipour's avatar Shayan Hajipour
Browse files

operation_type selection added to config rule creation

parent 319ea841
No related branches found
No related tags found
3 merge requests!346Draft: support for restconf protocol,!345Draft: support ipinfusion devices via netconf,!283Resolve "(CTTC) Implement L3 VPN SBI driver compatible with IETF L3 Service Model"
......@@ -229,6 +229,10 @@ class L3NM_IETFL3VPN_ServiceHandler(_ServiceHandler):
running_candidate_diff = get_running_candidate_ietf_slice_data_diff(
service_config
)
if not running_candidate_diff:
operation_type = "create"
elif "values_changed" in running_candidate_diff:
operation_type = "update"
LOGGER.debug("running_candidate_diff: %s", running_candidate_diff)
slice_services = candidate_resource_value_dict["network-slice-services"][
"slice-service"
......@@ -292,7 +296,7 @@ class L3NM_IETFL3VPN_ServiceHandler(_ServiceHandler):
"dst_ce_pe_network_prefix": dst_ce_address_prefix,
"dst_mtu": MTU,
}
json_config_rules = setup_config_rules(service_uuid, resource_value_dict)
json_config_rules = setup_config_rules(service_uuid, resource_value_dict, operation_type)
del controller.device_config.config_rules[:]
for jcr in json_config_rules:
controller.device_config.config_rules.append(ConfigRule(**jcr))
......
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