Cluster deletion status code fix 85/15085/3
authorshrinithi <shrinithi.r@tataelxsi.co.in>
Fri, 21 Mar 2025 18:37:44 +0000 (18:37 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 9 May 2025 09:22:06 +0000 (11:22 +0200)
Change-Id: I2a341e5957b78a31c5e8eebfe8195812c43fe632
Signed-off-by: shrinithi <shrinithi.r@tataelxsi.co.in>
osm_nbi/k8s_topics.py

index 6898498..20bd76f 100644 (file)
@@ -60,7 +60,7 @@ class InfraContTopic(ProfileTopic):
     schema_edit = infra_controller_profile_create_edit_schema
 
     def __init__(self, db, fs, msg, auth):
-        BaseTopic.__init__(self, db, fs, msg, auth)
+        super().__init__(db, fs, msg, auth)
 
     def new(self, rollback, session, indata=None, kwargs=None, headers=None):
         # To create the new infra controller profile
@@ -82,7 +82,7 @@ class InfraConfTopic(ProfileTopic):
     schema_edit = infra_config_profile_create_edit_schema
 
     def __init__(self, db, fs, msg, auth):
-        BaseTopic.__init__(self, db, fs, msg, auth)
+        super().__init__(db, fs, msg, auth)
 
     def new(self, rollback, session, indata=None, kwargs=None, headers=None):
         # To create the new infra config profile
@@ -104,7 +104,7 @@ class AppTopic(ProfileTopic):
     schema_edit = app_profile_create_edit_schema
 
     def __init__(self, db, fs, msg, auth):
-        BaseTopic.__init__(self, db, fs, msg, auth)
+        super().__init__(db, fs, msg, auth)
 
     def new(self, rollback, session, indata=None, kwargs=None, headers=None):
         # To create the new app profile
@@ -126,7 +126,7 @@ class ResourceTopic(ProfileTopic):
     schema_edit = resource_profile_create_edit_schema
 
     def __init__(self, db, fs, msg, auth):
-        BaseTopic.__init__(self, db, fs, msg, auth)
+        super().__init__(db, fs, msg, auth)
 
     def new(self, rollback, session, indata=None, kwargs=None, headers=None):
         # To create the new resource profile
@@ -556,12 +556,14 @@ class ClusterTopic(ACMTopic):
         filter_q = self._get_project_filter(session)
         filter_q[self.id_field(self.topic, _id)] = _id
         check = self.db.get_one(self.topic, filter_q)
+        op_id = check["current_operation"]
         if check["created"] == "false":
             raise EngineException(
                 "Cannot delete registered cluster. Please deregister.",
                 HTTPStatus.UNPROCESSABLE_ENTITY,
             )
         super().delete(session, _id, dry_run, not_send_msg)
+        return op_id
 
 
 class ClusterOpsTopic(ACMTopic):
@@ -775,7 +777,7 @@ class ClusterOpsTopic(ACMTopic):
             {"cluster_id": _id, "operation_id": op_id},
             not_send_msg=not_send_msg,
         )
-        return None
+        return _id
 
 
 class KsusTopic(ACMTopic):