1
0
Fork 0

plugins: do not run cleanup command with argument none

This commit is contained in:
Jaroslav Škarvada 2012-10-29 14:52:02 +01:00
parent 3c7916e4fa
commit 3be4b62872

View file

@ -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):