From 3be4b628726b85669b7e2d00eec71163ffddd669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Mon, 29 Oct 2012 14:52:02 +0100 Subject: [PATCH] plugins: do not run cleanup command with argument none --- tuned/plugins/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tuned/plugins/base.py b/tuned/plugins/base.py index 6c2eb33..a29683f 100644 --- a/tuned/plugins/base.py +++ b/tuned/plugins/base.py @@ -127,7 +127,8 @@ class Plugin(object): if not command["per_device"]: storage_key = self._storage_key(command_name) old_value = self._storage.get(storage_key) - command["set"](old_value) + if old_value: + command["set"](old_value) self._storage.unset(storage_key) return @@ -137,7 +138,8 @@ class Plugin(object): for device in self._devices: storage_key = self._storage_key(command_name, device) old_value = self._storage.get(storage_key) - command["set"](old_value, device) + if old_value: + command["set"](old_value, device) self._storage.unset(storage_key) def execute_commands(self):