From 4cdd08f73c6727cff81e7514010d6faaf9a6b10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Fri, 25 Jan 2019 01:48:40 +0100 Subject: [PATCH] Fixed disk plugin to correctly match devices with python3 --- ...checking-the-removable-attribute-on-.patch | 35 +++++++++++++++++++ tuned.spec | 8 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-plugin_disk-Fix-checking-the-removable-attribute-on-.patch diff --git a/0001-plugin_disk-Fix-checking-the-removable-attribute-on-.patch b/0001-plugin_disk-Fix-checking-the-removable-attribute-on-.patch new file mode 100644 index 0000000..49ce5ab --- /dev/null +++ b/0001-plugin_disk-Fix-checking-the-removable-attribute-on-.patch @@ -0,0 +1,35 @@ +From 2cc3d747986837d7e7957f5a4baede2dd691348a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= +Date: Thu, 24 Jan 2019 16:28:24 +0100 +Subject: [PATCH] plugin_disk: Fix checking the 'removable' attribute on + python3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The 'removable' attribute is a bytestring, so it will never be equal to +"0" in python3. Check equality with b"0" instead. + +The patch was originally written by Tomáš Korbař. + +Signed-off-by: Ondřej Lysoněk +--- + tuned/plugins/plugin_disk.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tuned/plugins/plugin_disk.py b/tuned/plugins/plugin_disk.py +index 1de1257..65504d8 100644 +--- a/tuned/plugins/plugin_disk.py ++++ b/tuned/plugins/plugin_disk.py +@@ -39,7 +39,7 @@ class DiskPlugin(hotplug.Plugin): + @classmethod + def _device_is_supported(cls, device): + return device.device_type == "disk" and \ +- device.attributes.get("removable", None) == "0" and \ ++ device.attributes.get("removable", None) == b"0" and \ + (device.parent is None or \ + device.parent.subsystem in ["scsi", "virtio", "xen"]) + +-- +2.20.1 + diff --git a/tuned.spec b/tuned.spec index 47247c0..88d13c2 100644 --- a/tuned.spec +++ b/tuned.spec @@ -32,7 +32,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.10.0 -Release: 5%{?prerel1}%{?dist} +Release: 6%{?prerel1}%{?dist} License: GPLv2+ Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel2}.tar.gz URL: http://www.tuned-project.org/ @@ -63,6 +63,8 @@ Patch1: 0001-tuned-adm-Fix-a-traceback-when-run-without-action-sp.patch Patch2: tuned-2.10.0-makefile-full-python-path.patch # Upstream patch: Patch3: 0001-tuned-gui-Sort-plugins-based-on-their-name.patch +# Upstream patch +Patch4: 0001-plugin_disk-Fix-checking-the-removable-attribute-on-.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -211,6 +213,7 @@ It can be also used to fine tune your system for specific scenarios. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build @@ -443,6 +446,9 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Fri Jan 25 2019 Jaroslav Škarvada - 2.10.0-6 +- Fixed disk plugin to correctly match devices with python3 + * Sat Jul 14 2018 Fedora Release Engineering - 2.10.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild