1
0
Fork 0

audio plugin: fixed error handling in _get_timeout

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2013-03-01 11:29:09 +01:00
parent 518c383ff2
commit e4e829b5f9

View file

@ -63,11 +63,10 @@ class AudioPlugin(base.Plugin):
@command_get("timeout")
def _get_timeout(self, device):
sys_file = self._timeout_path(device)
try:
value = tuned.utils.commands.read_file(sys_file)
value = tuned.utils.commands.read_file(sys_file)
if len(value) > 0:
return int(value)
except:
return None
return None
@command_custom("reset_controller", per_device=True, priority=10)
def _reset_controller(self, enabling, value, device):