From 10ab83e55f399124075d44cd8f1747287e2626f38e439ce5dbc96320154785ef Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 5 Sep 2017 08:05:16 +0000 Subject: [PATCH 1/2] Accepting request 518023 from home:LSZhu:branches:devel:languages:python Update to version 2.1.fb64,improve ALUA and TCMU support OBS-URL: https://build.opensuse.org/request/show/518023 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rtslib-fb?expand=0&rev=22 --- python-rtslib-fb.changes | 10 ++++++++++ python-rtslib-fb.spec | 8 ++++---- rtslib-fb-2.1.fb63.tar.xz | 3 --- rtslib-fb-2.1.fb64.tar.gz | 3 +++ 4 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 rtslib-fb-2.1.fb63.tar.xz create mode 100644 rtslib-fb-2.1.fb64.tar.gz diff --git a/python-rtslib-fb.changes b/python-rtslib-fb.changes index 865d9e9..ef2ae8e 100644 --- a/python-rtslib-fb.changes +++ b/python-rtslib-fb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 17 08:03:10 UTC 2017 - lszhu@suse.com + +- Update to version 2.1.fb64 + *Improve ALUA and TCMU support, as well as moving the default + directory for APTPL files from /var/target to /etc/target + for better FHS compliance. + *Remove patch Switch-target-driver-DB-root-dir-to-etc-target.patch + from the spec file because upstream already has this change. + ------------------------------------------------------------------- Thu Jun 8 21:37:20 UTC 2017 - lduncan@suse.com diff --git a/python-rtslib-fb.spec b/python-rtslib-fb.spec index 51d1e83..8ec842f 100644 --- a/python-rtslib-fb.spec +++ b/python-rtslib-fb.spec @@ -17,17 +17,17 @@ %define oname rtslib-fb -%define realver 2.1.fb63 +%define realver 2.1.fb64 %define dbdir /etc/target Name: python-%{oname} -Version: 2.1.63 +Version: 2.1.64 Release: 0%{?dist} Url: http://github.com/open-iscsi/rtslib-fb.git Summary: API for Linux kernel SCSI target (aka LIO) License: Apache-2.0 Group: Development/Languages/Python -Source: %{oname}-%{realver}.tar.xz +Source: %{oname}-%{realver}.tar.gz Patch1: Switch-target-driver-DB-root-dir-to-etc-target.patch Conflicts: python-rtslib BuildRequires: fdupes @@ -56,7 +56,7 @@ the Apache 2.0 license. Contributions are welcome %prep %setup -q -n %{oname}-%{realver} -%patch1 -p1 +#%patch1 -p1 %build %__python setup.py build diff --git a/rtslib-fb-2.1.fb63.tar.xz b/rtslib-fb-2.1.fb63.tar.xz deleted file mode 100644 index 3c9759e..0000000 --- a/rtslib-fb-2.1.fb63.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72a2c9d7671bba08194c7ea40145cc827e9c30b0523dca985fd42016f490d589 -size 39436 diff --git a/rtslib-fb-2.1.fb64.tar.gz b/rtslib-fb-2.1.fb64.tar.gz new file mode 100644 index 0000000..b804fd9 --- /dev/null +++ b/rtslib-fb-2.1.fb64.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dd1ce5a6d0797529a19eb08725ac0b92a9fc4b7f82e5a8929e61d48993bd426 +size 46387 From 1a8a084cb77229c93f74788835317970a972f0bcaad3404107b098f241293d94 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 28 Nov 2017 08:56:02 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rtslib-fb?expand=0&rev=23 --- ...get-driver-DB-root-dir-to-etc-target.patch | 98 ------------------- python-rtslib-fb.spec | 6 +- 2 files changed, 2 insertions(+), 102 deletions(-) delete mode 100644 Switch-target-driver-DB-root-dir-to-etc-target.patch diff --git a/Switch-target-driver-DB-root-dir-to-etc-target.patch b/Switch-target-driver-DB-root-dir-to-etc-target.patch deleted file mode 100644 index 496c2f7..0000000 --- a/Switch-target-driver-DB-root-dir-to-etc-target.patch +++ /dev/null @@ -1,98 +0,0 @@ -From f823033e5c6beced0590a00064e1e7a55e76a995 Mon Sep 17 00:00:00 2001 -From: Lee Duncan -Date: Tue, 13 Jun 2017 09:45:30 -0700 -Subject: [PATCH] Switch target driver DB root dir to /etc/target - -This switches the kernel target driver directory from -the default of /var/target to /etc/target, if the -"dbroot" sysfs attribute is present. If not, the default -of /var/target is maintained. This has to be done -by rtslib/root.py since this module loads the -target_core_mod module, where the dbroot value -must be updated before any target_core_* drivers -register with target_core_mod. ---- - rtslib/root.py | 24 ++++++++++++++++++++++++ - rtslib/tcm.py | 3 ++- - 2 files changed, 26 insertions(+), 1 deletion(-) - -diff --git a/rtslib/root.py b/rtslib/root.py -index 99a25b778cd1..ee7b1039bd06 100644 ---- a/rtslib/root.py -+++ b/rtslib/root.py -@@ -28,6 +28,7 @@ from .fabric import FabricModule - from .tcm import so_mapping, bs_cache, StorageObject - from .utils import RTSLibError, RTSLibALUANotSupported, modprobe, mount_configfs - from .utils import dict_remove, set_attributes -+from .utils import fread, fwrite - from .alua import ALUATargetPortGroup - - default_save_file = "/etc/target/saveconfig.json" -@@ -57,6 +58,12 @@ class RTSRoot(CFSNode): - ''' - - # RTSRoot private stuff -+ -+ # this should match the kernel target driver default db dir -+ _default_dbroot = "/var/target" -+ # this is where the target DB is to be located (instead of the default) -+ _preferred_dbroot = "/etc/target" -+ - def __init__(self): - ''' - Instantiate an RTSRoot object. Basically checks for configfs setup and -@@ -75,6 +82,8 @@ class RTSRoot(CFSNode): - modprobe('target_core_mod') - self._create_in_cfs_ine('any') - -+ self._set_dbroot_if_needed() -+ - def _list_targets(self): - self._check_self() - for fabric_module in self.fabric_modules: -@@ -148,6 +157,19 @@ class RTSRoot(CFSNode): - def __str__(self): - return "rtslib" - -+ def _set_dbroot_if_needed(self): -+ dbroot_path = self.path + "/dbroot" -+ if not os.path.exists(dbroot_path): -+ self._dbroot = self._default_dbroot -+ return -+ self._dbroot = fread(dbroot_path) -+ if self._dbroot != self._preferred_dbroot: -+ fwrite(dbroot_path, self._preferred_dbroot+"\n") -+ self._dbroot = fread(dbroot_path) -+ -+ def _get_dbroot(self): -+ return self._dbroot -+ - # RTSRoot public stuff - - def dump(self): -@@ -320,6 +342,8 @@ class RTSRoot(CFSNode): - doc="Get the list of all FabricModule objects.") - alua_tpgs = property(_list_alua_tpgs, - doc="Get the list of all ALUA TPG objects.") -+ dbroot = property(_get_dbroot, -+ doc="Get the target database root") - - def _test(): - '''Run the doctests.''' -diff --git a/rtslib/tcm.py b/rtslib/tcm.py -index 82ef34e0634e..73bfbe3b8359 100644 ---- a/rtslib/tcm.py -+++ b/rtslib/tcm.py -@@ -78,7 +78,8 @@ class StorageObject(CFSNode): - need to read it in and squirt it back into configfs when we configure - the storage object. BLEH. - """ -- aptpl_dir = "/var/target/pr" -+ from .root import RTSRoot -+ aptpl_dir = "%s/pr" % RTSRoot().dbroot - - try: - lines = fread("%s/aptpl_%s" % (aptpl_dir, self.wwn)).split() --- -2.12.3 - diff --git a/python-rtslib-fb.spec b/python-rtslib-fb.spec index 8ec842f..e0d19b2 100644 --- a/python-rtslib-fb.spec +++ b/python-rtslib-fb.spec @@ -28,7 +28,6 @@ Summary: API for Linux kernel SCSI target (aka LIO) License: Apache-2.0 Group: Development/Languages/Python Source: %{oname}-%{realver}.tar.gz -Patch1: Switch-target-driver-DB-root-dir-to-etc-target.patch Conflicts: python-rtslib BuildRequires: fdupes BuildRequires: python-devel @@ -38,7 +37,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: pyudev %description -rtslib-fb is an object-based Python library for configuring the LIO generic +rtslib-fb is an object-based Python library for configuring the LIO generic SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under the Apache 2.0 license. Contributions are welcome @@ -50,13 +49,12 @@ BuildRequires: epydoc BuildRequires: pyudev %description doc -rtslib-fb is an object-based Python library for configuring the LIO generic +rtslib-fb is an object-based Python library for configuring the LIO generic SCSI target, present in 3.x Linux kernel versions. rtslib-fb is licensed under the Apache 2.0 license. Contributions are welcome %prep %setup -q -n %{oname}-%{realver} -#%patch1 -p1 %build %__python setup.py build