Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tasks = set()
for node in walk_tree(self):
for ctrl in node.controllers.values():
tasks.update(ctrl.tasks)
return tasks
@property
def tasks(self):
"""Tasks in this exact group"""
tasks = set()
for ctrl in self.controllers.values():
tasks.update(ctrl.tasks)
return tasks
class NodeVM(NodeControlGroup):
"""Abstraction of a QEMU virtual machine node."""
@property
def verbose_name(self):
try:
return self.nodes[0].verbose_name
except:
return "AnonymousVM"
@property
def emulator(self):
return self.children_map.get("emulator", None)
@property
def vcpus(self):
def __init__(self, root_path=b"/sys/fs/cgroup", groups=None, sub_groups=None):
self.node_tree = BaseTree(root_path=root_path, groups=groups, sub_groups=sub_groups)
self.control_root = NodeControlGroup(name=b"cgroup")
for ctrl in self.node_tree.root.children:
self.control_root.add_node(ctrl)
self._init_control_tree(self.control_root)
def _create_node(self, name, parent):
return NodeControlGroup(name, parent=parent)