Repository: incubator-airflow Updated Branches: refs/heads/v1-8-stable 37b91bedd -> b8fd66172
[AIRFLOW-844] Fix cgroups directory creation Testing Done: - Tested locally, we should add cgroup tests at some point though Closes #2057 from aoen/ddavydov/fix_cgroups Signed-off-by: Bolke de Bruin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/b8fd6617 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/b8fd6617 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/b8fd6617 Branch: refs/heads/v1-8-stable Commit: b8fd66172b32aa24c16c16fd0c07c6f88450fa68 Parents: 37b91be Author: Dan Davydov <[email protected]> Authored: Mon Feb 6 16:21:05 2017 -0800 Committer: Bolke de Bruin <[email protected]> Committed: Tue Feb 7 21:49:52 2017 +0100 ---------------------------------------------------------------------- airflow/contrib/task_runner/cgroup_task_runner.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/b8fd6617/airflow/contrib/task_runner/cgroup_task_runner.py ---------------------------------------------------------------------- diff --git a/airflow/contrib/task_runner/cgroup_task_runner.py b/airflow/contrib/task_runner/cgroup_task_runner.py index 79aafc8..6a9e6cf 100644 --- a/airflow/contrib/task_runner/cgroup_task_runner.py +++ b/airflow/contrib/task_runner/cgroup_task_runner.py @@ -75,14 +75,12 @@ class CgroupTaskRunner(BaseTaskRunner): if path_element not in name_to_node: self.logger.debug("Creating cgroup {} in {}" .format(path_element, node.path)) - subprocess.check_output("sudo mkdir -p {}".format(path_element)) - subprocess.check_output("sudo chown -R {} {}".format( - self._cur_user, path_element)) + node = node.create_cgroup(path_element) else: self.logger.debug("Not creating cgroup {} in {} " "since it already exists" .format(path_element, node.path)) - node = name_to_node[path_element] + node = name_to_node[path_element] return node def _delete_cgroup(self, path):
