提交 cd97b2c6 编写于 作者: C chunfuwen

Python 3: fix re.search() using string pattern on a bytes-like object

re.search(regexp, out) need regexp and out in the same type:string or bytes
currently regexp is string,but out is bytes,which throw TypeError
Fix this issue by transfering out into string forcedly
Signed-off-by: Nchunfuwen <chwen@redhat.com>
上级 3a60cc5b
......@@ -103,9 +103,9 @@ def loaded_module_info(module_name):
dependent on, list of dictionary of param name and type
:rtype: dict
"""
l_raw = process.system_output('/sbin/lsmod')
l_raw = process.system_output('/sbin/lsmod').decode('utf-8')
modinfo_dic = parse_lsmod_for_module(l_raw, module_name)
output = process.system_output("/sbin/modinfo %s" % module_name)
output = process.system_output("/sbin/modinfo %s" % module_name).decode('utf-8')
if output:
param_list = []
for line in output.splitlines():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册