diff mbox

[14/19] KVM test: kvm_preprocessing.py: don't explicitly print failure messages

Message ID 1252519932-30733-14-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Sept. 9, 2009, 6:12 p.m. UTC
This is taken care of elsewhere, so currently when something fails during
pre/post-processing, messages get logged twice.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_preprocessing.py |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index 8fa74cf..729e1d4 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -31,11 +31,8 @@  def preprocess_image(test, params):
         logging.debug("Creating image...")
         create_image = True
 
-    if create_image:
-        if not kvm_vm.create_image(params, test.bindir):
-            message = "Could not create image"
-            logging.error(message)
-            raise error.TestError(message)
+    if create_image and not kvm_vm.create_image(params, test.bindir):
+        raise error.TestError("Could not create image")
 
 
 def preprocess_vm(test, params, env, name):
@@ -78,11 +75,8 @@  def preprocess_vm(test, params, env, name):
                           "restarting it...")
             start_vm = True
 
-    if start_vm:
-        if not vm.create(name, params, test.bindir, for_migration):
-            message = "Could not start VM"
-            logging.error(message)
-            raise error.TestError(message)
+    if start_vm and not vm.create(name, params, test.bindir, for_migration):
+        raise error.TestError("Could not start VM")
 
     scrdump_filename = os.path.join(test.debugdir, "pre_%s.ppm" % name)
     vm.send_monitor_cmd("screendump %s" % scrdump_filename)