Lines Matching refs:pwd
54 pwd = mkdtemp(prefix='cgroup-', dir=root) + '/'
56 pwd = mkdtemp(prefix='cgroup-', dir=self.root) + '/'
60 return pwd
63 def rm_cgroup(self, pwd, supress=False): argument
72 os.rmdir(pwd)
95 def is_cgroup(self, pid, pwd): argument
102 if open(pwd + '/tasks').readlines().count("%d\n" % pid) > 0:
117 def set_cgroup(self, pid, pwd): argument
125 open(pwd+'/tasks', 'w').write(str(pid))
129 if self.is_cgroup(pid, pwd):
131 "failed", pid, pwd)
145 def get_prop(self, prop, pwd=None, supress=False): argument
153 tmp = self.get_property(prop, pwd, supress)
162 def get_property(self, prop, pwd=None, supress=False): argument
170 if pwd == None:
171 pwd = self.root
173 ret = open(pwd+prop, 'r').readlines()
181 def set_prop(self, prop, value, pwd=None, check=True): argument
204 return self.set_property(prop, value, pwd, check)
207 def set_property(self, prop, value, pwd=None, check=True): argument
217 if pwd == None:
218 pwd = self.root
220 open(pwd+prop, 'w').write(value)
226 _value = self.get_property(prop, pwd)[0][:-1]
240 pwd = self.mk_cgroup()
241 if pwd == None:
265 if self.set_cgroup(ps.pid, pwd):
271 if self.rm_cgroup(pwd, supress=True) == 0:
285 if self.rm_cgroup(pwd):