提交 93b925cc 编写于 作者: L Lukáš Doktor

qemu..smbios_table: Convert bytes to text

On py3 we need to convert results to text.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 b156546c
......@@ -5,6 +5,7 @@ from avocado.utils import process
from virttest import error_context
from virttest import env_process
from virttest import utils_misc
from virttest.compat_52lts import decode_to_text
@error_context.context_aware
......@@ -39,8 +40,8 @@ def run(test, params, env):
dmidecode_key = dmidecode_key.split()
for key in dmidecode_key:
cmd = (dmidecode_exp % (smbios_type_number, key))
default_key_para = process.system_output(
cmd, shell=True).strip()
default_key_para = decode_to_text(process.system_output(
cmd, shell=True).strip())
smbios_key_para_set = params.object_params(sm_type).get(key,
default_key_para)
smbios += ",%s='%s'" % (key.lower(), smbios_key_para_set)
......@@ -87,8 +88,8 @@ def run(test, params, env):
for key in dmidecode_key:
cmd = (dmidecode_exp % (smbios_type_number, key))
smbios_get_para = session.cmd(cmd).strip()
default_key_para = process.system_output(
cmd, shell=True).strip()
default_key_para = decode_to_text(process.system_output(
cmd, shell=True).strip())
if params.get("smbios_type_disable", "no") == "no":
smbios_set_para = params.object_params(sm_type).get(key,
default_key_para)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册