From 57718107f09371a56b40aab1e34105657d92ec71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 19 May 2015 13:31:09 +0200 Subject: [PATCH] plugin_sysctl: consolidate whitespaces in get results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- tuned/plugins/plugin_sysctl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py index 3836e1c..c22d8e2 100644 --- a/tuned/plugins/plugin_sysctl.py +++ b/tuned/plugins/plugin_sysctl.py @@ -1,3 +1,4 @@ +import re import base from decorators import * import tuned.logs @@ -69,7 +70,7 @@ class SysctlPlugin(base.Plugin): def _read_sysctl(self, option): retcode, stdout = self._execute_sysctl(["-e", option]) if retcode == 0: - parts = map(lambda value: value.strip(), stdout.split("=", 1)) + parts = map(lambda value: re.sub('\s+', ' ', value).strip(), stdout.split("=", 1)) if len(parts) == 2: option, value = parts return value