From 4fabcae0b4e8cee60ef8b562ad8c19e8a0493736 Mon Sep 17 00:00:00 2001 From: Volker Eckert Date: Fri, 21 Dec 2018 15:11:42 +0000 Subject: [PATCH] cgroups.py: strip slashes, don't drop first char this makes it cope with both, names starting with or without slashes --- devlib/module/cgroups.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devlib/module/cgroups.py b/devlib/module/cgroups.py index 6846abf..71885a6 100644 --- a/devlib/module/cgroups.py +++ b/devlib/module/cgroups.py @@ -262,8 +262,9 @@ class CGroup(object): # Control cgroup path self.directory = controller.mount_point + 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 self.tasks_file = self.target.path.join(self.directory, 'tasks')