@@ -236,6 +236,7 @@ def remove(self, ip: str, port: int) -> task.DagDetailDTO:
236
236
237
237
Returns:
238
238
Task detail as task.DagDetailDTO.
239
+ return None if the agent is not in the uninitialized cluster.
239
240
240
241
Raises:
241
242
OBShellHandleError: error message return by OBShell server.
@@ -256,7 +257,7 @@ def remove_sync(self, ip: str, port: int) -> task.DagDetailDTO:
256
257
include the failed task detail and logs.
257
258
"""
258
259
dag = self .remove (ip , port )
259
- return self .wait_dag_succeed (dag .generic_id )
260
+ return None if dag is None else self .wait_dag_succeed (dag .generic_id )
260
261
261
262
def config_observer (self ,
262
263
configs : dict ,
@@ -1138,6 +1139,7 @@ def drop_tenant_sync(self, tenant_name: str, need_recycle: bool = False) -> task
1138
1139
1139
1140
Returns:
1140
1141
Task detail as task.DagDetailDTO.
1142
+ Return None if tenant not exist.
1141
1143
1142
1144
Raises:
1143
1145
OBShellHandleError: error message return by OBShell server.
@@ -1237,14 +1239,15 @@ def delete_tenant_replica_sync(self, tenant_name: str, zones: List[str]) -> task
1237
1239
1238
1240
Returns:
1239
1241
Task detail as task.DagDetailDTO.
1242
+ Return None if there is no replica on zones.
1240
1243
1241
1244
Raises:
1242
1245
OBShellHandleError: error message return by OBShell server.
1243
1246
TaskExecuteFailedError: raise when the task failed,
1244
1247
include the failed task detail and logs.
1245
1248
"""
1246
1249
dag = self .delete_tenant_replica (tenant_name , zones )
1247
- return self .wait_dag_succeed (dag .generic_id )
1250
+ return None if dag is None else self .wait_dag_succeed (dag .generic_id )
1248
1251
1249
1252
def modify_tenant_replica (self , tenant_name : str , zone_list : List [tenant .ModifyReplicaParam ]) -> task .DagDetailDTO :
1250
1253
"""Modifies tenant replicas.
@@ -1423,7 +1426,7 @@ def purge_recyclebin_tenant(self, object_or_original_name: str) -> task.DagDetai
1423
1426
f"/api/v1/recyclebin/tenant/{ object_or_original_name } " , "DELETE" )
1424
1427
return self .__handle_task_ret_request (req )
1425
1428
1426
- def purge_recyclebin_tenant_sync (self , object_or_original_name : str ) -> bool :
1429
+ def purge_recyclebin_tenant_sync (self , object_or_original_name : str ) -> task . DagDetailDTO :
1427
1430
"""Purges the tenant in recyclebin synchronously.
1428
1431
1429
1432
Args:
@@ -1433,7 +1436,8 @@ def purge_recyclebin_tenant_sync(self, object_or_original_name: str) -> bool:
1433
1436
The resource of the tenant won't be recycled.
1434
1437
1435
1438
Returns:
1436
- bool: True if success.
1439
+ Task detail as task.DagDetailDTO.
1440
+ Return None if the tenant not exist in recyclebin.
1437
1441
1438
1442
Raises:
1439
1443
OBShellHandleError: Error message return by OBShell server.
0 commit comments