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

cgroups.py: strip slashes, don't drop first char

this makes it cope with both, names starting with or without slashes
This commit is contained in:
Volker Eckert 2018-12-21 15:11:42 +00:00 committed by Marc Bonnici
parent 3c4a282c29
commit 4fabcae0b4

View File

@ -262,8 +262,9 @@ class CGroup(object):
# Control cgroup path # Control cgroup path
self.directory = controller.mount_point self.directory = controller.mount_point
if name != '/': if name != '/':
self.directory = self.target.path.join(controller.mount_point, name[1:]) self.directory = self.target.path.join(controller.mount_point, name.strip('/'))
# Setup path for tasks file # Setup path for tasks file
self.tasks_file = self.target.path.join(self.directory, 'tasks') self.tasks_file = self.target.path.join(self.directory, 'tasks')