targetcli/0002-restoreconfig-do-not-return-success.patch
Maurizio Lombardi 4194bd078f restoreconfig: Do not return success if the file doesn't exist
Resolves: RHEL-135093

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
2025-12-11 09:57:31 +01:00

15 lines
581 B
Diff

diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py
index 79ee985..2dd6614 100644
--- a/targetcli/ui_root.py
+++ b/targetcli/ui_root.py
@@ -207,8 +207,7 @@ class UIRoot(UINode):
savefile = os.path.expanduser(savefile)
if not os.path.isfile(savefile):
- self.shell.log.info("Restore file %s not found" % savefile)
- return
+ raise ExecutionError(f"Restore file {savefile} not found")
target = self.ui_eval_param(target, 'string', None)
storage_object = self.ui_eval_param(storage_object, 'string', None)