diff mbox

KVM Test: Catch AttributeError and make screendump thread continue.

Message ID 1309240969-13614-1-git-send-email-fyang@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Feng Yang June 28, 2011, 6:02 a.m. UTC
From: Feng Yang <fyang@redhat.com>

screendump is start before vm creating.  At most time, it is ok.

But when setting start_vm to no, then create vm in tests script.
This may could not work. screendump thread exit for AttributeError exception.
Some of our unattended_install case fail for this reason.

In order to fix this issue, we may:
1. catch AttributeError exception and make screendump thread continue.
This way is easy fix, but if we do not need vm in a case, screendump thread
will still alive, and print useless debug log.

2. start screendmup thread in vm.create(), then close it in vm.destroy().
This need more work and may bring other problem.

This patch use first way. Please help comment it.

Signed-off-by: Feng Yang <fyang@redhat.com>
---
 client/virt/virt_env_process.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
index 1eb8ecf..ac3c6f1 100644
--- a/client/virt/virt_env_process.py
+++ b/client/virt/virt_env_process.py
@@ -433,6 +433,9 @@  def _take_screendumps(test, params, env):
             except kvm_monitor.MonitorError, e:
                 logging.warn(e)
                 continue
+            except AttributeError, e:
+                logging.warn(e)
+                continue
             if not os.path.exists(temp_filename):
                 logging.warn("VM '%s' failed to produce a screendump", vm.name)
                 continue