From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yolkfull Chow Subject: Re: [Autotest] [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py Date: Mon, 25 Jan 2010 10:53:53 +0800 Message-ID: <20100125025353.GA2260@aFu.nay.redhat.com> References: <330437955.2245901262252904715.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> <1311733026.2245921262253140971.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Reply-To: Yolkfull Chow Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, autotest@test.kernel.org To: Michael Goldish Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8421 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752920Ab0AYCx7 (ORCPT ); Sun, 24 Jan 2010 21:53:59 -0500 Content-Disposition: inline In-Reply-To: <1311733026.2245921262253140971.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Dec 31, 2009 at 04:52:20AM -0500, Michael Goldish wrote: > GOOD/FAIL/ERROR lines are always preceded by START lines, and info_list > is appended a "" when parsing a START line, so it seems unreasonable > for info_list to be empty when parsing a GOOD/FAIL/ERROR line. > What file did you parse when you got that exception? Can you reproduce > the problem and show me the file that caused it? > I guess the file was either corrupt, or of an unknown new format. > If the latter is true, we should study the new format and modify the > code accordingly. Hi Michael, So sorry for late reply. I just saw this email. Maybe I should consider change the email client 'mutt' to 'Thunderbird' because I often miss some unread emails. And I cannot now find the file cause that exception.But I could reproduce at that time. Let's temporarily skip this patch now and look into it if find it again in future. Thanks for your analysis. :) > > ----- "Yolkfull Chow" wrote: > > > 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 > > > > _______________________________________________ > > Autotest mailing list > > Autotest@test.kernel.org > > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html