@@ -291,28 +291,31 @@ def clone(self, args):
291
291
resource_group = args .resource_group
292
292
)
293
293
294
- rc = self .handle_replies (args , clone_resp .messages )
295
-
296
- if rc == ExitCode .OK and not args .no_wait :
297
- if not args .machine_readable :
298
- print ("Waiting for cloning to complete..." )
299
- try :
300
- res = self .get_linstorapi ().resource_dfn_clone_wait_complete (
301
- clone_resp .source_name , clone_resp .clone_name , timeout = args .wait_timeout )
302
- if not res :
303
- rc = ExitCode .API_ERROR
294
+ if not args .curl :
295
+ rc = self .handle_replies (args , clone_resp .messages )
296
+
297
+ if rc == ExitCode .OK and not args .no_wait :
304
298
if not args .machine_readable :
305
- if res :
306
- print ("{msg} cloning {c}." .format (
307
- c = clone_resp .clone_name , msg = Output .color_str ("Completed" , Color .GREEN , args .no_color )))
308
- else :
309
- print ("{msg} cloning {c}, please check resource status or satellite errors." .format (
310
- c = clone_resp .clone_name , msg = Output .color_str ("Failed" , Color .RED , args .no_color )))
311
- except linstor .LinstorApiCallError as e :
312
- rc = ExitCode .API_ERROR
313
- Output .handle_ret (e .main_error , args .no_color , False , sys .stderr )
314
-
315
- return rc
299
+ print ("Waiting for cloning to complete..." )
300
+ try :
301
+ res = self .get_linstorapi ().resource_dfn_clone_wait_complete (
302
+ clone_resp .source_name , clone_resp .clone_name , timeout = args .wait_timeout )
303
+ if not res :
304
+ rc = ExitCode .API_ERROR
305
+ if not args .machine_readable :
306
+ if res :
307
+ print ("{msg} cloning {c}." .format (
308
+ c = clone_resp .clone_name ,
309
+ msg = Output .color_str ("Completed" , Color .GREEN , args .no_color )))
310
+ else :
311
+ print ("{msg} cloning {c}, please check resource status or satellite errors." .format (
312
+ c = clone_resp .clone_name , msg = Output .color_str ("Failed" , Color .RED , args .no_color )))
313
+ except linstor .LinstorApiCallError as e :
314
+ rc = ExitCode .API_ERROR
315
+ Output .handle_ret (e .main_error , args .no_color , False , sys .stderr )
316
+
317
+ return rc
318
+ return ExitCode .OK
316
319
317
320
def wait_sync (self , args ):
318
321
# this method either returns True or raises
0 commit comments