Moved OKA usage state update code to LCM 99/15199/3
authoryshah <shahithya.y@tataelxsi.co.in>
Mon, 19 May 2025 12:31:50 +0000 (12:31 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 20 May 2025 14:25:47 +0000 (16:25 +0200)
Change-Id: Iaaa30ae8346f08c3e6424213b456fd1d1bc220c6
Signed-off-by: yshah <shahithya.y@tataelxsi.co.in>
osm_nbi/k8s_topics.py

index 20bd76f..3cf676b 100644 (file)
@@ -1044,33 +1044,6 @@ class KsusTopic(ACMTopic):
         )
         self.db.set_one(self.topic, {"_id": item_content["_id"]}, item_content)
 
-        if item_content["oka"][0].get("_id"):
-            used_oka = {}
-            existing_oka = []
-            for okas in item_content["oka"]:
-                used_oka["_id"] = okas["_id"]
-
-            filter = self._get_project_filter(session)
-            data = self.db.get_list(self.topic, filter)
-
-            if data:
-                for ksus in data:
-                    if ksus["_id"] != _id:
-                        for okas in ksus["oka"]:
-                            self.logger.info("OKA: {}".format(okas))
-                            if okas.get("sw_catalog_path", ""):
-                                continue
-                            elif okas["_id"] not in existing_oka:
-                                existing_oka.append(okas["_id"])
-
-            if used_oka:
-                for oka, oka_id in used_oka.items():
-                    if oka_id not in existing_oka:
-                        self.db.set_one(
-                            self.okapkg_topic,
-                            {"_id": oka_id},
-                            {"_admin.usageState": "NOT_IN_USE"},
-                        )
         # Check if the profile exists. If it doesn't, no message should be sent to Kafka
         not_send_msg = None
         profile_id = item_content["profile"]["_id"]