1
0
Fork 0

plugins: do not crash if devices are not specified

This commit is contained in:
Jan Vcelak 2012-10-09 16:43:25 +02:00
parent d891e3f2ee
commit d5e1657a84
2 changed files with 5 additions and 3 deletions

View file

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

View file

@ -1,7 +1,7 @@
import base
import tuned.logs
import os
from subprocess import Popen
from subprocess import Popen, PIPE
log = tuned.logs.get()