From f1528b7e096ba23cb0bb4d3c1c4a85f259b1a69c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 07:04:27 +0000 Subject: import python-rtslib-2.1.72-1.el7 --- diff --git a/.gitignore b/.gitignore index c26a4c1..233ed9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rtslib-fb-2.1.fb69.tar.gz +SOURCES/rtslib-fb-2.1.72.tar.gz diff --git a/.python-rtslib.metadata b/.python-rtslib.metadata index f5dc9d2..7bc5db4 100644 --- a/.python-rtslib.metadata +++ b/.python-rtslib.metadata @@ -1 +1 @@ -4148d5c9083d72a952d431809db1adbea93668de SOURCES/rtslib-fb-2.1.fb69.tar.gz +b44c8b66a8002c4d7eb6203639d151b0c956b11e SOURCES/rtslib-fb-2.1.72.tar.gz diff --git a/SOURCES/0003-report-the-correct-size-for-partitions.patch b/SOURCES/0003-report-the-correct-size-for-partitions.patch deleted file mode 100644 index dd7b6b8..0000000 --- a/SOURCES/0003-report-the-correct-size-for-partitions.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 560ee483a9ff0fbaa130e70573c7f27ba7a413ad Mon Sep 17 00:00:00 2001 -From: Maurizio Lombardi -Date: Fri, 19 Oct 2018 10:52:01 +0200 -Subject: [PATCH] report the correct size for partitions - -If you use a partition instead of the whole device as the backstore device, -rtslib will always report its size as 0 bytes. - -This happens because rtslib tries to read the "queue/logical_block_size" -attribute, which can only be found in the parent's node. -This patch fixes the bug by loading the parent node's attributes if -it detects that the device is a partition. - -Signed-off-by: Maurizio Lombardi ---- - rtslib/utils.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/rtslib/utils.py b/rtslib/utils.py -index b4e68fb..eff2205 100644 ---- a/rtslib/utils.py -+++ b/rtslib/utils.py -@@ -134,6 +134,9 @@ def _get_size_for_dev(device): - except (KeyError, UnicodeDecodeError, ValueError): - return 0 - -+ if device['DEVTYPE'] == 'partition': -+ attributes = device.parent.attributes -+ - try: - logical_block_size = attributes.asint('queue/logical_block_size') - except (KeyError, UnicodeDecodeError, ValueError): --- -1.8.3.1 - diff --git a/SOURCES/0004-save_to_file-function-breaks-symbolic-link-when-savi.patch b/SOURCES/0004-save_to_file-function-breaks-symbolic-link-when-savi.patch deleted file mode 100644 index 8412e64..0000000 --- a/SOURCES/0004-save_to_file-function-breaks-symbolic-link-when-savi.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5626a4d593df9384fff5129e7bdb6c909f5f2b11 Mon Sep 17 00:00:00 2001 -From: Maurizio Lombardi -Date: Fri, 8 Feb 2019 14:36:34 +0100 -Subject: [PATCH] save_to_file() function breaks symbolic link when saving - configuration - -Currently the location of the targetcli configuration file is not -configurable (saveconfig.json). The location is : /etc/target -Some users use stateless VMs, with just a persistent device -mounted under /var/lib/diskless. - -In order to circumvent the non configurable location of -saveconfig.json, they create a symbolic link in /etc/target -pointing to /var/lib/diskless - -Unfortunately, the rtslib save_to_file() function breaks -this symbolic link and creates a new regular file in place of it, -due to the creation of a saveconfig.json.temp file which is -then renamed to saveconfig.json using the os.rename() function. - -This patch replace os.rename() with shutil.copyfile() + os.remove(), -using copyfile() instead of rename() will preserve the symbolic link - -Signed-off-by: Maurizio Lombardi ---- - rtslib/root.py | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/rtslib/root.py b/rtslib/root.py -index 5c0a98c..c93e65b 100644 ---- a/rtslib/root.py -+++ b/rtslib/root.py -@@ -23,6 +23,7 @@ import stat - import json - import glob - import errno -+import shutil - - from .node import CFSNode - from .target import Target -@@ -386,7 +387,9 @@ class RTSRoot(CFSNode): - else: - saveconf = self.dump() - -- with open(save_file+".temp", "w+") as f: -+ tmp_file = save_file + ".temp" -+ -+ with open(tmp_file, "w+") as f: - os.fchmod(f.fileno(), stat.S_IRUSR | stat.S_IWUSR) - f.write(json.dumps(saveconf, sort_keys=True, indent=2)) - f.write("\n") -@@ -394,7 +397,8 @@ class RTSRoot(CFSNode): - os.fsync(f.fileno()) - f.close() - -- os.rename(save_file+".temp", save_file) -+ shutil.copyfile(tmp_file, save_file) -+ os.remove(tmp_file) - - def restore_from_file(self, restore_file=None, clear_existing=True, abort_on_error=False): - ''' --- -2.21.0 - diff --git a/SPECS/python-rtslib.spec b/SPECS/python-rtslib.spec index 8a581e4..2ff4d59 100644 --- a/SPECS/python-rtslib.spec +++ b/SPECS/python-rtslib.spec @@ -8,15 +8,13 @@ Name: python-rtslib License: ASL 2.0 Group: System Environment/Libraries Summary: API for Linux kernel LIO SCSI target -Version: 2.1.fb69 -Release: 3%{?dist} -URL: https://fedorahosted.org/targetcli-fb/ -Source: https://fedorahosted.org/released/targetcli-fb/%{oname}-%{version}.tar.gz +Version: 2.1.72 +Release: 1%{?dist} +URL: https://github.com/open-iscsi/%{oname} +Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz Source1: target.service Patch0: 0001-Turn-off-unsupported-fabrics.patch Patch1: 0002-Fix-comparisons-to-None.patch -Patch2: 0003-report-the-correct-size-for-partitions.patch -Patch3: 0004-save_to_file-function-breaks-symbolic-link-when-savi.patch BuildArch: noarch BuildRequires: python-devel epydoc python-setuptools systemd-units python-six python-pyudev Requires: python-kmod python-six python-pyudev @@ -55,8 +53,6 @@ API for generic Linux SCSI kernel target. %setup -q -n %{oname}-%{version} %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -130,6 +126,9 @@ popd %doc doc/html %changelog +* Fri Apr 03 2020 Maurizio Lombardi - 2.1.72-1 +- Update to the latest upstream version + * Tue May 14 2019 Maurizio Lombardi - 2.1.fb69-3 - save_to_file() function breaks symbolic link when saving configuration