From 6c2892f14fa988817b7673fab43a28de385d3df9 Mon Sep 17 00:00:00 2001 From: Xueqiang Wei Date: Tue, 20 Nov 2018 18:38:49 +0800 Subject: [PATCH] qemu.test: fix python3 compatibility issue 1. for case block_discard and physical_resources_check Signed-off-by: Xueqiang Wei --- qemu/tests/block_discard.py | 2 +- qemu/tests/physical_resources_check.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/tests/block_discard.py b/qemu/tests/block_discard.py index b44316d4..3f59f06d 100644 --- a/qemu/tests/block_discard.py +++ b/qemu/tests/block_discard.py @@ -32,7 +32,7 @@ def run(test, params, env): """ Get latest scsi disk which emulated by scsi_debug module. """ - scsi_disk_info = process.system_output("lsscsi").splitlines() + scsi_disk_info = process.system_output("lsscsi").decode().splitlines() scsi_debug = [_ for _ in scsi_disk_info if 'scsi_debug' in _][-1] scsi_debug = scsi_debug.split() host_id = scsi_debug[0][1:-1] diff --git a/qemu/tests/physical_resources_check.py b/qemu/tests/physical_resources_check.py index f48a6f22..353d3a53 100644 --- a/qemu/tests/physical_resources_check.py +++ b/qemu/tests/physical_resources_check.py @@ -175,8 +175,8 @@ def run(test, params, env): test.error("Failed to get machine type from vm") machine_type_cmd = "%s -M ?" % utils_misc.get_qemu_binary(params) - machine_types = process.system_output(machine_type_cmd, - ignore_status=True) + machine_types = process.system_output( + machine_type_cmd, ignore_status=True).decode() machine_types = machine_types.split(':')[-1] machine_type_map = {} for machine_type in machine_types.splitlines(): -- GitLab