plugins: do not crash if devices are not specified
This commit is contained in:
parent
d891e3f2ee
commit
d5e1657a84
2 changed files with 5 additions and 3 deletions
|
|
@ -110,7 +110,8 @@ class Plugin(object):
|
|||
command["set"](new_value)
|
||||
return
|
||||
|
||||
assert self._devices is not None
|
||||
if self._devices is None:
|
||||
return
|
||||
|
||||
for device in self._devices:
|
||||
current_value = command["get"](device)
|
||||
|
|
@ -131,7 +132,8 @@ class Plugin(object):
|
|||
self._storage.unset(storage_key)
|
||||
return
|
||||
|
||||
assert self._devices is not None
|
||||
if self._devices is None:
|
||||
return
|
||||
|
||||
for device in self._devices:
|
||||
storage_key = self._storage_key(command_name, device)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import base
|
||||
import tuned.logs
|
||||
import os
|
||||
from subprocess import Popen
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
log = tuned.logs.get()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue