未验证 提交 0b066ef8 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'apahim/spell_v47'

Signed-off-by: NCleber Rosa <crosa@redhat.com>
......@@ -207,18 +207,18 @@ def get_children_pids(ppid, recursive=False):
"""
Get all PIDs of children/threads of parent ppid
param ppid: parent PID
param recursive: True to return all levels of subprocesses
param recursive: True to return all levels of sub-processes
return: list of PIDs of all children/threads of ppid
"""
cmd = "ps -L --ppid=%d -o lwp"
# Getting first level of subprocesses
# Getting first level of sub-processes
children = system_output(cmd % ppid, verbose=False).split('\n')[1:]
if not recursive:
return children
# Recursion to get all levels of subprocesses
# Recursion to get all levels of sub-processes
for child in children:
children.extend(system_output(cmd % int(child),
verbose=False,
......
......@@ -425,3 +425,6 @@ nic
sysfs
vpd
teststmpdir
deepcopy
arg
thp
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册