diff mbox

[KVM-AUTOTEST,08/17] KVM test: let kvm_vm.create_image() raise a CmdError if qemu-img fails

Message ID 1294079238-21239-8-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Jan. 3, 2011, 6:27 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index c237fbe..32be55e 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -203,19 +203,8 @@  def create_image(params, root_dir):
     size = params.get("image_size", "10G")
     qemu_img_cmd += " %s" % size
 
-    try:
-        utils.system(qemu_img_cmd)
-    except error.CmdError, e:
-        logging.error("Could not create image; qemu-img command failed:\n%s",
-                      str(e))
-        return None
-
-    if not os.path.exists(image_filename):
-        logging.error("Image could not be created for some reason; "
-                      "qemu-img command:\n%s" % qemu_img_cmd)
-        return None
-
-    logging.info("Image created in %s" % image_filename)
+    utils.system(qemu_img_cmd)
+    logging.info("Image created in %r" % image_filename)
     return image_filename