You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by da...@apache.org on 2017/02/07 00:21:26 UTC

incubator-airflow git commit: [AIRFLOW-844] Fix cgroups directory creation

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 973f7d6a8 -> a7deb6264


[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


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/a7deb626
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/a7deb626
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/a7deb626

Branch: refs/heads/master
Commit: a7deb6264b0e00baedaf7b2fb433ce29ca0ea593
Parents: 973f7d6
Author: Dan Davydov <da...@airbnb.com>
Authored: Mon Feb 6 16:21:05 2017 -0800
Committer: Dan Davydov <da...@airbnb.com>
Committed: Mon Feb 6 16:21:08 2017 -0800

----------------------------------------------------------------------
 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/a7deb626/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):