Skip to content

Commit 76f28a0

Browse files
committed
rd/clone: fix crash if --curl was set
1 parent 7f93262 commit 76f28a0

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
### Fixed
12+
13+
- rd clone: fix crash if --curl was set
14+
1115
## [1.25.3] - 2025-04-08
1216

1317
### Fixed

linstor_client/commands/rsc_dfn_cmds.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -291,28 +291,31 @@ def clone(self, args):
291291
resource_group=args.resource_group
292292
)
293293

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:
304298
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
316319

317320
def wait_sync(self, args):
318321
# this method either returns True or raises

0 commit comments

Comments
 (0)