From: yshah Date: Mon, 19 May 2025 12:31:50 +0000 (+0000) Subject: Moved OKA usage state update code to LCM X-Git-Tag: v18.0.0~18 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=0085806fe3fba34c8db2ce87f28e258c25c39052;p=osm%2FNBI.git Moved OKA usage state update code to LCM Change-Id: Iaaa30ae8346f08c3e6424213b456fd1d1bc220c6 Signed-off-by: yshah --- diff --git a/osm_nbi/k8s_topics.py b/osm_nbi/k8s_topics.py index 20bd76f..3cf676b 100644 --- a/osm_nbi/k8s_topics.py +++ b/osm_nbi/k8s_topics.py @@ -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"]