[packages/targetcli-fb] - release 3, fix crash when removing backstores

adamg adamg at pld-linux.org
Thu Feb 7 08:26:04 CET 2019


commit c15e42efaed358f664947a9c554321602727c042
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date:   Thu Feb 7 08:25:57 2019 +0100

    - release 3, fix crash when removing backstores

 targetcli-fb-no-save-flag.patch | 34 ++++++++++++++++++++++++++++++++++
 targetcli-fb.spec               |  4 +++-
 2 files changed, 37 insertions(+), 1 deletion(-)
---
diff --git a/targetcli-fb.spec b/targetcli-fb.spec
index ef8e911..77c786f 100644
--- a/targetcli-fb.spec
+++ b/targetcli-fb.spec
@@ -1,13 +1,14 @@
 Summary:	Command shell for managing Linux LIO kernel target
 Name:		targetcli-fb
 Version:	2.1.fb49
-Release:	2
+Release:	3
 License:	Apache v2.0
 Group:		Applications/System
 Source0:	https://codeload.github.com/open-iscsi/targetcli-fb/tar.gz/v%{version}
 # Source0-md5:	416eeda8f7ddeb7f00fe98dc1a6245b3
 Source1:	targetcli.service
 Source2:	targetcli.init
+Patch0:		%{name}-no-save-flag.patch
 URL:		https://github.com/open-iscsi/targetcli-fb
 BuildRequires:	rpmbuild(macros) >= 1.647
 Requires:	python-configshell-fb
@@ -24,6 +25,7 @@ generic SCSI target, present in 3.x Linux kernel versions.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %py_build
diff --git a/targetcli-fb-no-save-flag.patch b/targetcli-fb-no-save-flag.patch
new file mode 100644
index 0000000..bf540a7
--- /dev/null
+++ b/targetcli-fb-no-save-flag.patch
@@ -0,0 +1,34 @@
+fix crash whem removing backstore:
+/> /backstores/fileio/ delete adamg250g_iscsi
+
+Traceback (most recent call last):
+  File "/usr/bin/targetcli", line 122, in <module>
+    main()
+  File "/usr/bin/targetcli", line 112, in main
+    shell.run_interactive()
+  File "/usr/share/python2.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
+  File "/usr/share/python2.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
+  File "/usr/share/python2.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
+  File "/usr/share/python2.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
+  File "/usr/share/python2.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
+  File "/usr/share/python2.7/site-packages/targetcli/ui_backstore.py", line 309, in ui_command_delete
+TypeError: delete() got an unexpected keyword argument 'save'
+
+
+this is introduced in bca03ea (saveconfig: way for block-level save with delete command),
+but the rtslib_fb was not updated to handle it.
+
+For now we just revert to previous way of calling delete (no arguments).
+
+--- targetcli-fb-2.1.fb49/targetcli/ui_backstore.py~	2018-09-05 14:08:11.000000000 +0200
++++ targetcli-fb-2.1.fb49/targetcli/ui_backstore.py	2019-02-07 08:19:44.277352926 +0100
+@@ -306,7 +306,8 @@
+             rn = self.get_root()
+             rn._save_backups(default_save_file)
+ 
+-        child.rtsnode.delete(save=save)
++        # child.rtsnode.delete(save=save)
++        child.rtsnode.delete()
+         self.remove_child(child)
+         self.shell.log.info("Deleted storage object %s." % name)
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/targetcli-fb.git/commitdiff/c15e42efaed358f664947a9c554321602727c042



More information about the pld-cvs-commit mailing list