public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py
@ 2009-12-30  9:47 Yolkfull Chow
  2009-12-30  9:47 ` [AUTOTEST PATCH 2/2] KVM-test: Move two 'remote_login' out of try block in kvm_vm.py Yolkfull Chow
  0 siblings, 1 reply; 5+ messages in thread
From: Yolkfull Chow @ 2009-12-30  9:47 UTC (permalink / raw)
  To: autotest; +Cc: kvm, Yolkfull Chow

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


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <278734081.2246011262253625627.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-12-31 10:03 ` [AUTOTEST PATCH 2/2] KVM-test: Move two 'remote_login' out of try block in kvm_vm.py Michael Goldish
2010-01-12 22:37   ` [Autotest] " Lucas Meneghel Rodrigues
2010-01-13  2:24     ` Yolkfull Chow
2010-01-13  2:22   ` Yolkfull Chow
2009-12-30  9:47 [AUTOTEST PATCH 1/2] KVM-test: Fix a bug that about list slice in scan_results.py Yolkfull Chow
2009-12-30  9:47 ` [AUTOTEST PATCH 2/2] KVM-test: Move two 'remote_login' out of try block in kvm_vm.py Yolkfull Chow

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