From 781ce73b106edeb163c52c771380782ef2aaa460 Mon Sep 17 00:00:00 2001 From: yshah Date: Fri, 28 Feb 2025 08:56:13 +0000 Subject: [PATCH] Force delete operation passing force option in kafka Change-Id: I43f0db196ad196aea0a29a0cb567b6cbf3e69cb5 Signed-off-by: yshah --- osm_nbi/acm_topic.py | 2 +- osm_nbi/k8s_topics.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/osm_nbi/acm_topic.py b/osm_nbi/acm_topic.py index 12ee1a8..8d529aa 100644 --- a/osm_nbi/acm_topic.py +++ b/osm_nbi/acm_topic.py @@ -330,7 +330,7 @@ class ProfileTopic(ACMTopic): def delete_extra_before(self, session, _id, db_content, not_send_msg=None): op_id = self.common_delete(_id, db_content) - return {"profile_id": _id, "operation_id": op_id} + return {"profile_id": _id, "operation_id": op_id, "force": session["force"]} def delete_profile(self, session, _id, dry_run=False, not_send_msg=None): item_content = self.db.get_one(self.topic, {"_id": _id}) diff --git a/osm_nbi/k8s_topics.py b/osm_nbi/k8s_topics.py index 6e7fd25..1e73bb2 100644 --- a/osm_nbi/k8s_topics.py +++ b/osm_nbi/k8s_topics.py @@ -557,7 +557,7 @@ class ClusterTopic(ACMTopic): def delete_extra_before(self, session, _id, db_content, not_send_msg=None): op_id = self.common_delete(_id, db_content) - return {"cluster_id": _id, "operation_id": op_id} + return {"cluster_id": _id, "operation_id": op_id, "force": session["force"]} def delete(self, session, _id, dry_run=False, not_send_msg=None): filter_q = self._get_project_filter(session) @@ -969,7 +969,11 @@ class KsusTopic(ACMTopic): _id_list.append(_id) if _id_list: - data = {"ksus_list": _id_list, "operation_id": op_id} + data = { + "ksus_list": _id_list, + "operation_id": op_id, + "force": session["force"], + } self._send_msg("delete", data, not_send_msg) return op_id @@ -1133,7 +1137,9 @@ class OkaTopic(DescriptorTopic, ACMOperationTopic): ) self.db.set_one(self.topic, {"_id": item_content["_id"]}, item_content) self._send_msg( - "delete", {"oka_id": _id, "operation_id": op_id}, not_send_msg=not_send_msg + "delete", + {"oka_id": _id, "operation_id": op_id, "force": session["force"]}, + not_send_msg=not_send_msg, ) return op_id -- 2.25.1