mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 05:30:44 +00:00
Merge pull request #177 from bjackman/hwmon-no-permissions
hwmon: Disable if no permissions
This commit is contained in:
commit
e21265f6f6
@ -15,6 +15,7 @@
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
||||
from devlib import TargetError
|
||||
from devlib.module import Module
|
||||
from devlib.utils.types import integer
|
||||
|
||||
@ -116,7 +117,15 @@ class HwmonModule(Module):
|
||||
|
||||
@staticmethod
|
||||
def probe(target):
|
||||
return target.file_exists(HWMON_ROOT)
|
||||
if not target.file_exists(HWMON_ROOT):
|
||||
return False
|
||||
try:
|
||||
target.list_directory(HWMON_ROOT, as_root=target.is_rooted)
|
||||
except TargetError:
|
||||
# Probably no permissions
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@property
|
||||
def sensors(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user