diff --git a/tuned/plugins/base.py b/tuned/plugins/base.py index 9ea10cc..b9cf04c 100644 --- a/tuned/plugins/base.py +++ b/tuned/plugins/base.py @@ -490,8 +490,8 @@ class Plugin(object): def _norm_value(self, value): v = self._cmd.unquote(str(value)) - if re.match(r'\s*(0+,)+[\da-fA-F]*\s*$', v): - return re.sub(r'^\s*(0+,)+', "", v) + if re.match(r'\s*(0+,?)+([\da-fA-F]*,?)*\s*$', v): + return re.sub(r'^\s*(0+,?)+', "", v) return v def _verify_value(self, name, new_value, current_value, ignore_missing, device = None): diff --git a/tuned/plugins/plugin_sysfs.py b/tuned/plugins/plugin_sysfs.py index e0b9f80..6733643 100644 --- a/tuned/plugins/plugin_sysfs.py +++ b/tuned/plugins/plugin_sysfs.py @@ -60,7 +60,7 @@ class SysfsPlugin(base.Plugin): return re.match(r"^/sys/.*", sysfs_file) def _read_sysfs(self, sysfs_file): - data = self._cmd.read_file(sysfs_file) + data = self._cmd.read_file(sysfs_file).strip() if len(data) > 0: return self._cmd.get_active_option(data, False) else: