From d0e28f0a892d73821854760693f62b4e569512ec Mon Sep 17 00:00:00 2001
From: Brendan Jackman <brendan.jackman@arm.com>
Date: Thu, 12 Jan 2017 16:38:12 +0000
Subject: [PATCH] cgroups: Fix run_into method

The current run_into method attempts to execute:

  <...>/shutils CGMOUNT=<...> cgroups_run_into <...>

Which should instead be:

  CGMOUNT=<...> <...>/shutils cgroups_run_into <...>

So just use cgroups_run_into_cmd to generate the command, then execute that.
---
 devlib/module/cgroups.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/devlib/module/cgroups.py b/devlib/module/cgroups.py
index 0cc8413..25b1194 100644
--- a/devlib/module/cgroups.py
+++ b/devlib/module/cgroups.py
@@ -392,11 +392,8 @@ class CgroupsModule(Module):
         :param cgroup: Name of cgroup to run command into
         :returns: Output of command.
         """
-        return self.target._execute_util(
-            'CGMOUNT={} cgroups_run_into {} {}'\
-                .format(self.cgroup_root, cgroup, cmdline),
-            as_root=True)
-
+        cmd = self.run_into_cmd(cgroup, cmdline)
+        return self.target.execute(cmd)
 
     def cgroups_tasks_move(self, srcg, dstg, exclude=''):
         """