trace actions done on cgroups so we can check if this happens within the lifespan...
[nodemanager.git] / cgroups.py
index b1635c0..43a549d 100644 (file)
@@ -82,7 +82,7 @@ def get_cgroup_path(name, subsystem="cpuset"):
     if result is None:
         name = name + ".libvirt-lxc"
         result = reduce(lambda a, b: b if name in os.path.basename(b) else a,
-                      get_cgroup_paths(subsystem), None)
+                        get_cgroup_paths(subsystem), None)
 
     return result
 
@@ -98,12 +98,14 @@ def write(name, key, value, subsystem="cpuset"):
     base_path = get_cgroup_path(name, subsystem)
     with open(os.path.join(base_path, key), 'w') as f:
         print >>f, value
+    logger.verbose("cgroups.write: overwrote {}".format(base_path))
 
 def append(name, key, value, subsystem="cpuset"):
     """ Appends a value to the file key with the cgroup with name """
     base_path = get_cgroup_path(name, subsystem)
     with open(os.path.join(base_path, key), 'a') as f:
         print >>f, value
+    logger.verbose("cgroups.append: appended {}".format(base_path))
 
 if __name__ == '__main__':