check_positive has some contradictions
1. 在`check_positive()`函数的raise语句中,错误信息与if条件冲突。 2. 如果`val`的值为 0,它会通过if条件,但会抛出错误信息,提示`[0 has to be >= 0]`。 3. 该PR移除了raise语句中的`=`,因此当`val`为0时,会正确提示`val`的值`[has to be > 0]`。 (cherry picked from commit 66dea7cbb83f724a40d5995a0e5de4ea6566d235)
This commit is contained in:
parent
9ba71a509b
commit
f3bb5e211c
25
bugfix-check_positive-has-some-contradictions.patch
Normal file
25
bugfix-check_positive-has-some-contradictions.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From d55d5c280758b6fed2c8c598a380c3c6cdc11b18 Mon Sep 17 00:00:00 2001
|
||||||
|
From: dufuhang <dufuhang@kylinos.cn>
|
||||||
|
Date: Thu, 19 Sep 2024 14:15:53 +0800
|
||||||
|
Subject: [PATCH] check_positive has some contradictions
|
||||||
|
|
||||||
|
---
|
||||||
|
tuned-adm.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tuned-adm.py b/tuned-adm.py
|
||||||
|
index fcf19e2..6e5ac85 100755
|
||||||
|
--- a/tuned-adm.py
|
||||||
|
+++ b/tuned-adm.py
|
||||||
|
@@ -34,7 +34,7 @@ def check_positive(value):
|
||||||
|
except ValueError:
|
||||||
|
val = -1
|
||||||
|
if val <= 0:
|
||||||
|
- raise argparse.ArgumentTypeError("%s has to be >= 0" % value)
|
||||||
|
+ raise argparse.ArgumentTypeError("%s has to be > 0" % value)
|
||||||
|
return val
|
||||||
|
|
||||||
|
def check_log_level(value):
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Summary: A system tuning service for Linux
|
Summary: A system tuning service for Linux
|
||||||
Name: tuned
|
Name: tuned
|
||||||
Version: 2.20.0
|
Version: 2.20.0
|
||||||
Release: 2
|
Release: 3
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Source0: https://github.com/redhat-performance/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source0: https://github.com/redhat-performance/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
URL: http://www.tuned-project.org/
|
URL: http://www.tuned-project.org/
|
||||||
@ -36,6 +36,7 @@ Patch2: tuned-2.18.0-sd-load-balance.patch
|
|||||||
Patch3: change-the-default-percentage-when-dirty-data-starts.patch
|
Patch3: change-the-default-percentage-when-dirty-data-starts.patch
|
||||||
Patch4: tuned-add-app-sensor-profile.patch
|
Patch4: tuned-add-app-sensor-profile.patch
|
||||||
Patch5: profiles-drop-sched_-tuning-where-appropriate.patch
|
Patch5: profiles-drop-sched_-tuning-where-appropriate.patch
|
||||||
|
Patch6: bugfix-check_positive-has-some-contradictions.patch
|
||||||
|
|
||||||
Provides: tuned-gtk = %{version}-%{release}
|
Provides: tuned-gtk = %{version}-%{release}
|
||||||
Provides: tuned-utils = %{version}-%{release}
|
Provides: tuned-utils = %{version}-%{release}
|
||||||
@ -295,6 +296,9 @@ fi
|
|||||||
%{_mandir}/man7/tuned-profiles-spectrumscale-ece.7*
|
%{_mandir}/man7/tuned-profiles-spectrumscale-ece.7*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 19 2024 dufuhang <dufuhang@kylinos.cn> - 2.20.0-3
|
||||||
|
- bugfix: check_positive has some contradictions
|
||||||
|
|
||||||
* Fri Apr 12 2024 liuchao <liuchao173@huawei.com> - 2.20.0-2
|
* Fri Apr 12 2024 liuchao <liuchao173@huawei.com> - 2.20.0-2
|
||||||
- profiles: drop sched_ tuning where appropriate
|
- profiles: drop sched_ tuning where appropriate
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user