1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

module/thermal: List directories with as_root=target.is_rooted

Listing thermal zones directories in sysfs fails one some system when running as
non-root.

Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
This commit is contained in:
Douglas RAILLARD 2019-10-16 11:49:14 +01:00 committed by Marc Bonnici
parent 6b72b50c40
commit 207291e940

View File

@ -48,7 +48,7 @@ class ThermalZone(object):
self.path = target.path.join(root, self.name)
self.trip_points = {}
for entry in self.target.list_directory(self.path):
for entry in self.target.list_directory(self.path, as_root=target.is_rooted):
re_match = re.match('^trip_point_([0-9]+)_temp', entry)
if re_match is not None:
self.add_trip_point(re_match.group(1))