plugins: do not run cleanup command with argument none
This commit is contained in:
parent
3c7916e4fa
commit
3be4b62872
1 changed files with 4 additions and 2 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue