diff mbox

virt.virt_env_process: Take screenshots pre/post test only when required

Message ID 1314389217-31026-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Aug. 26, 2011, 8:06 p.m. UTC
This patch makes the env processor code that takes a
VM screenshot pre/post a test runs depending on the
value of the take_regular_screendumps config variable.

Usually, we either want all screenshots or none of them.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
 client/virt/virt_env_process.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
index 8ef6497..8ab9e3d 100644
--- a/client/virt/virt_env_process.py
+++ b/client/virt/virt_env_process.py
@@ -86,7 +86,7 @@  def preprocess_vm(test, params, env, name):
 
     scrdump_filename = os.path.join(test.debugdir, "pre_%s.ppm" % name)
     try:
-        if vm.monitor:
+        if vm.monitor and params.get("take_regular_screendumps") == "yes":
             vm.monitor.screendump(scrdump_filename, debug=False)
     except kvm_monitor.MonitorError, e:
         logging.warn(e)
@@ -122,7 +122,7 @@  def postprocess_vm(test, params, env, name):
 
     scrdump_filename = os.path.join(test.debugdir, "post_%s.ppm" % name)
     try:
-        if vm.monitor:
+        if vm.monitor and params.get("take_regular_screenshots") == "yes":
             vm.monitor.screendump(scrdump_filename, debug=False)
     except kvm_monitor.MonitorError, e:
         logging.warn(e)