public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py
       [not found] <330437955.2245901262252904715.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
@ 2009-12-31  9:52 ` Michael Goldish
  2010-01-25  2:53   ` [Autotest] " Yolkfull Chow
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Goldish @ 2009-12-31  9:52 UTC (permalink / raw)
  To: Yolkfull Chow; +Cc: autotest, kvm

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.

----- "Yolkfull Chow" <yzhou@redhat.com> 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 <yzhou@redhat.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Autotest] [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py
  2009-12-31  9:52 ` [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py Michael Goldish
@ 2010-01-25  2:53   ` Yolkfull Chow
  0 siblings, 0 replies; 2+ messages in thread
From: Yolkfull Chow @ 2010-01-25  2:53 UTC (permalink / raw)
  To: Michael Goldish; +Cc: kvm, autotest

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" <yzhou@redhat.com> 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 <yzhou@redhat.com>
> > ---
> >  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-25  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <330437955.2245901262252904715.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-12-31  9:52 ` [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py Michael Goldish
2010-01-25  2:53   ` [Autotest] " Yolkfull Chow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox