From eefc016a45b46b1770cb469c2224f1a2a5ceb402 Mon Sep 17 00:00:00 2001
From: hajipour <shajipour@cttc.es>
Date: Sat, 4 Jan 2025 16:17:14 +0100
Subject: [PATCH] debug: match criteria extraction in slice creation fixed

---
 .../service_handlers/l3nm_nce/L3NMNCEServiceHandler.py    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/service/service/service_handlers/l3nm_nce/L3NMNCEServiceHandler.py b/src/service/service/service_handlers/l3nm_nce/L3NMNCEServiceHandler.py
index 3e9380bae..cbf92ac80 100644
--- a/src/service/service/service_handlers/l3nm_nce/L3NMNCEServiceHandler.py
+++ b/src/service/service/service_handlers/l3nm_nce/L3NMNCEServiceHandler.py
@@ -171,7 +171,6 @@ class L3NMNCEServiceHandler(_ServiceHandler):
         endpoints: List[Tuple[str, str, Optional[str]]],
         connection_uuid: Optional[str] = None,
     ) -> List[Union[bool, Exception]]:
-        LOGGER.debug(f"P3: {len(endpoints)} {endpoints}")
         chk_type("endpoints", endpoints, list)
         if len(endpoints) == 0:
             return []
@@ -207,7 +206,6 @@ class L3NMNCEServiceHandler(_ServiceHandler):
             service_name = running_resource_value_dict["network-slice-services"][
                 "slice-service"
             ][0]["id"]
-            LOGGER.debug(f"P1: {service_name}")
             if not running_candidate_diff:  # Slice Creation
                 operation_type = "create"
                 slice_services = candidate_resource_value_dict[
@@ -328,7 +326,9 @@ class L3NMNCEServiceHandler(_ServiceHandler):
                     raise Exception(
                         "connection group missmatch in destination sdp and added connection group"
                     )
-                match_criteria = removed_sdp["service-match-criteria"]["match-criterion"]
+                match_criteria = removed_sdp["service-match-criteria"][
+                    "match-criterion"
+                ]
                 match_criterion = match_criteria[0]
             for type_value in match_criterion["match-type"]:
                 if type_value["type"] == "ietf-network-slice-service:source-ip-prefix":
@@ -414,7 +414,7 @@ class L3NMNCEServiceHandler(_ServiceHandler):
             self.__task_executor.configure_device(controller)
             LOGGER.debug('Configured device "{:s}"'.format(controller.name))
         except Exception as e:  # pylint: disable=broad-except
-            LOGGER.exception(f'P4: {e}')
+            LOGGER.exception(f"P4: {e}")
             raise e
             results.append(e)
         return results
-- 
GitLab