未验证 提交 356da7f0 编写于 作者: BDuck2014's avatar BDuck2014 提交者: GitHub

Fixing #1390 modules key in info command (#1393)

When modules are present, INFO's response will contain a `modules` key which will be a list of dicts describing each module. 
Co-authored-by: Njiekun.zhu <jiekun.zhu@shopee.com>
上级 5a6a50b5
......@@ -141,7 +141,13 @@ def parse_info(response):
key, value = line.split(':', 1)
if key == 'cmdstat_host':
key, value = line.rsplit(':', 1)
info[key] = get_value(value)
if key == 'module':
# Hardcode a list for key 'modules' since there could be
# multiple lines that started with 'module'
info.setdefault('modules', []).append(get_value(value))
else:
info[key] = get_value(value)
else:
# if the line isn't splittable, append it to the "__raw__" key
info.setdefault('__raw__', []).append(line)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册