From e5a05ea8f0d06353f6f506da57eb117d342c17a4 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Tue, 23 Apr 2024 11:08:13 +0000 Subject: [PATCH] PathComp component- Frontend: - Merged logics to manage composition of config rules --- .../algorithms/tools/ComposeConfigRules.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py b/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py index d5d5ad286..f92f9b2ff 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py @@ -184,23 +184,10 @@ def compose_device_config_rules( device_endpoint_keys = set(itertools.product(device_keys, endpoint_keys)) if len(device_endpoint_keys.intersection(endpoints_traversed)) == 0: continue - subservice_config_rules.append(config_rule) - match = RE_ENDPOINT_VLAN_SETTINGS.match(config_rule.custom.resource_key) - if match is not None: - device_uuid_or_name = match.group(1) - device_name_or_uuid = device_name_mapping[device_uuid_or_name] - device_keys = {device_uuid_or_name, device_name_or_uuid} + # TODO: check if vlan needs to be removed from config_rule + #config_rule.custom.resource_key = re.sub('\/vlan\[[^\]]+\]', '', config_rule.custom.resource_key) - endpoint_uuid_or_name = match.group(2) - endpoint_name_or_uuid_1 = endpoint_name_mapping[(device_uuid_or_name, endpoint_uuid_or_name)] - endpoint_name_or_uuid_2 = endpoint_name_mapping[(device_name_or_uuid, endpoint_uuid_or_name)] - endpoint_keys = {endpoint_uuid_or_name, endpoint_name_or_uuid_1, endpoint_name_or_uuid_2} - - device_endpoint_keys = set(itertools.product(device_keys, endpoint_keys)) - if len(device_endpoint_keys.intersection(endpoints_traversed)) == 0: continue - # ! check later: vlan removed from config_rule - config_rule.custom.resource_key = re.sub('\/vlan\[[^\]]+\]', '', config_rule.custom.resource_key) subservice_config_rules.append(config_rule) else: continue -- GitLab