)
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"]