Force delete operation passing force option in kafka 02/15002/3
authoryshah <shahithya.y@tataelxsi.co.in>
Fri, 28 Feb 2025 08:56:13 +0000 (08:56 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 18 Mar 2025 10:23:13 +0000 (11:23 +0100)
Change-Id: I43f0db196ad196aea0a29a0cb567b6cbf3e69cb5
Signed-off-by: yshah <shahithya.y@tataelxsi.co.in>
osm_nbi/acm_topic.py
osm_nbi/k8s_topics.py

index 12ee1a8..8d529aa 100644 (file)
@@ -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})
index 6e7fd25..1e73bb2 100644 (file)
@@ -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