|
|
5ef531 |
From a8f2a8306e1bac6cfc739e6753d381bf509c995e Mon Sep 17 00:00:00 2001
|
|
|
5ef531 |
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
|
|
|
5ef531 |
Date: Fri, 9 Aug 2019 11:40:48 +0200
|
|
|
5ef531 |
Subject: [PATCH] plugin_sysctl: fixed traceback with modifiers '>', '<' and
|
|
|
5ef531 |
orig==new
|
|
|
5ef531 |
MIME-Version: 1.0
|
|
|
5ef531 |
Content-Type: text/plain; charset=UTF-8
|
|
|
5ef531 |
Content-Transfer-Encoding: 8bit
|
|
|
5ef531 |
|
|
|
5ef531 |
It fixed the following problem e.g. the profile:
|
|
|
5ef531 |
[sysctl]
|
|
|
5ef531 |
kernel.pid_max=>131072
|
|
|
5ef531 |
|
|
|
5ef531 |
and if kernel.pid_max is already 131072 Tuned shows traceback.
|
|
|
5ef531 |
|
|
|
5ef531 |
Resolves: rhbz#1739418
|
|
|
5ef531 |
|
|
|
5ef531 |
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
|
|
|
5ef531 |
---
|
|
|
5ef531 |
tuned/plugins/plugin_sysctl.py | 5 +++--
|
|
|
5ef531 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
5ef531 |
|
|
|
5ef531 |
diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
|
|
|
5ef531 |
index bcaead2..b298bfa 100644
|
|
|
5ef531 |
--- a/tuned/plugins/plugin_sysctl.py
|
|
|
5ef531 |
+++ b/tuned/plugins/plugin_sysctl.py
|
|
|
5ef531 |
@@ -54,12 +54,13 @@ class SysctlPlugin(base.Plugin):
|
|
|
5ef531 |
log.error("sysctl option %s will not be set, failed to read the original value."
|
|
|
5ef531 |
% option)
|
|
|
5ef531 |
else:
|
|
|
5ef531 |
- instance._sysctl_original[option] = original_value
|
|
|
5ef531 |
new_value = self._variables.expand(
|
|
|
5ef531 |
self._cmd.unquote(value))
|
|
|
5ef531 |
new_value = self._process_assignment_modifiers(
|
|
|
5ef531 |
new_value, original_value)
|
|
|
5ef531 |
- _write_sysctl(option, new_value)
|
|
|
5ef531 |
+ if new_value is not None:
|
|
|
5ef531 |
+ instance._sysctl_original[option] = original_value
|
|
|
5ef531 |
+ _write_sysctl(option, new_value)
|
|
|
5ef531 |
|
|
|
5ef531 |
storage_key = self._storage_key(instance.name)
|
|
|
5ef531 |
self._storage.set(storage_key, instance._sysctl_original)
|
|
|
5ef531 |
--
|
|
|
5ef531 |
2.20.1
|
|
|
5ef531 |
|