1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 10:50:51 +01:00

hwmon: Use as_root=True when listing directories

This commit is contained in:
Brendan Jackman 2017-01-04 11:21:22 +00:00
parent e88c6880ab
commit beaa229279

View File

@ -85,7 +85,8 @@ class HwmonDevice(object):
path = self.path
if not path.endswith(self.target.path.sep):
path += self.target.path.sep
for entry in self.target.list_directory(path):
for entry in self.target.list_directory(path,
as_root=self.target.is_rooted):
match = HWMON_FILE_REGEX.search(entry)
if match:
kind = match.group('kind')
@ -131,7 +132,8 @@ class HwmonModule(Module):
self.scan()
def scan(self):
for entry in self.target.list_directory(self.root):
for entry in self.target.list_directory(self.root,
as_root=self.target.is_rooted):
if entry.startswith('hwmon'):
entry_path = self.target.path.join(self.root, entry)
if self.target.file_exists(self.target.path.join(entry_path, 'name')):