Apparently some versions of virsh shipped around miss the
'screenshot' command, in that case, print an error message
and suggest the user to turn off regular screenshot taking
on tests.cfg rather than let this relatively minor problem
stop the tests.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/virt/libvirt_vm.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index 5ed4279..e806cdd 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -82,7 +82,12 @@ def virsh_uuid(name, uri = ""):
 
 
 def virsh_screenshot(name, filename, uri = ""):
-    virsh_cmd("screenshot %s %s" % (name, filename), uri)
+    try:
+        virsh_cmd("screenshot %s %s" % (name, filename), uri)
+    except error.CmdError, detail:
+        logging.error("Error taking VM %s screenshot. You might have to set "
+                      "take_regular_screenshots=no on your tests.cfg config "
+                      "file \n%s", name, detail)
     return filename
 
 
-- 
1.7.7.6

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to