fix: expand variables in Plugin._verify_all_device_commands
Need to expand variables before calling the @command function. This is actually done for _execute_all[_non]_device_commands and _verify_all_non_device_commands, but not in _verify_all_device_commands. This adds the missing expansion. (cherry picked from commit 225f47f83f5c21c88dd06c74b1493b14eced4968)
This commit is contained in:
parent
51b399ad6c
commit
f431964b7b
25
bugfix-expand-variables-in-Plugin.patch
Normal file
25
bugfix-expand-variables-in-Plugin.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 48a01d08ea325354c37b8f68c02c28fa424ddff6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
|
||||||
|
Date: Fri, 20 Sep 2024 09:01:54 +0800
|
||||||
|
Subject: [PATCH] fix:expand variables in Plugin._verify_all_device_commands
|
||||||
|
|
||||||
|
---
|
||||||
|
tuned/plugins/base.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tuned/plugins/base.py b/tuned/plugins/base.py
|
||||||
|
index 784d44d..c43cbb6 100644
|
||||||
|
--- a/tuned/plugins/base.py
|
||||||
|
+++ b/tuned/plugins/base.py
|
||||||
|
@@ -452,7 +452,7 @@ class Plugin(object):
|
||||||
|
def _verify_all_device_commands(self, instance, devices, ignore_missing):
|
||||||
|
ret = True
|
||||||
|
for command in [command for command in list(self._commands.values()) if command["per_device"]]:
|
||||||
|
- new_value = instance.options.get(command["name"], None)
|
||||||
|
+ new_value = self._variables.expand(instance.options.get(command["name"], None))
|
||||||
|
if new_value is None:
|
||||||
|
continue
|
||||||
|
for device in devices:
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
From f5a69ca8a7b602fdb79ae56425a2e36d6fb501a4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: lilinjie <lilinjie@uniontech.com>
|
|
||||||
Date: Tue, 7 Mar 2023 13:38:46 +0800
|
|
||||||
Subject: [PATCH] fix 'is_active' does not work
|
|
||||||
|
|
||||||
---
|
|
||||||
tuned-gui.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/tuned-gui.py b/tuned-gui.py
|
|
||||||
index 3953f82..746789b 100755
|
|
||||||
--- a/tuned-gui.py
|
|
||||||
+++ b/tuned-gui.py
|
|
||||||
@@ -362,7 +362,7 @@ class Base(object):
|
|
||||||
if profile is None:
|
|
||||||
self.error_dialog('No profile selected!', '')
|
|
||||||
return
|
|
||||||
- if self._gobj('windowProfileEditor').is_active():
|
|
||||||
+ if self._gobj('windowProfileEditor').is_visible():
|
|
||||||
self.error_dialog('You are ediding '
|
|
||||||
+ self.editing_profile_name
|
|
||||||
+ ' profile.',
|
|
||||||
--
|
|
||||||
2.31.1
|
|
||||||
|
|
||||||
@ -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: 3
|
Release: 4
|
||||||
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/
|
||||||
@ -37,6 +37,7 @@ 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
|
Patch6: bugfix-check_positive-has-some-contradictions.patch
|
||||||
|
Patch7: bugfix-expand-variables-in-Plugin.patch
|
||||||
|
|
||||||
Provides: tuned-gtk = %{version}-%{release}
|
Provides: tuned-gtk = %{version}-%{release}
|
||||||
Provides: tuned-utils = %{version}-%{release}
|
Provides: tuned-utils = %{version}-%{release}
|
||||||
@ -296,6 +297,9 @@ fi
|
|||||||
%{_mandir}/man7/tuned-profiles-spectrumscale-ece.7*
|
%{_mandir}/man7/tuned-profiles-spectrumscale-ece.7*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 20 2024 dufuhang <dufuhang@kylinos.cn> - 2.20.0-4
|
||||||
|
- bugfix: expand variables in Plugin._verify_all_device_commands
|
||||||
|
|
||||||
* Thu Sep 19 2024 dufuhang <dufuhang@kylinos.cn> - 2.20.0-3
|
* Thu Sep 19 2024 dufuhang <dufuhang@kylinos.cn> - 2.20.0-3
|
||||||
- bugfix: check_positive has some contradictions
|
- bugfix: check_positive has some contradictions
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user