From: Yolkfull Chow Subject: [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py Date: Wed, 30 Dec 2009 17:47:24 +0800 Message-ID: <1262166445-7759-1-git-send-email-yzhou@redhat.com> Cc: kvm@vger.kernel.org, Yolkfull Chow To: autotest@test.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbZL3Jr2 (ORCPT ); Wed, 30 Dec 2009 04:47:28 -0500 Sender: kvm-owner@vger.kernel.org List-ID: If 'info_list' is empty slice operation can result in traceback: ... info_list[-1] = parts[5] IndexError: list assignment index out of range Signed-off-by: Yolkfull Chow --- client/tests/kvm/scan_results.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py index f7bafa9..1daff2f 100755 --- a/client/tests/kvm/scan_results.py +++ b/client/tests/kvm/scan_results.py @@ -45,6 +45,7 @@ def parse_results(text): # Found a FAIL/ERROR/GOOD line -- get failure/success info elif (len(parts) >= 6 and parts[3].startswith("timestamp") and parts[4].startswith("localtime")): + info_list.append("") info_list[-1] = parts[5] return result_list -- 1.6.6