From patchwork Mon Jan 3 18:27:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 448591 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p03IQlhU023945 for ; Mon, 3 Jan 2011 18:26:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751760Ab1ACS0y (ORCPT ); Mon, 3 Jan 2011 13:26:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37859 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766Ab1ACS0x (ORCPT ); Mon, 3 Jan 2011 13:26:53 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p03IQq2u025427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2011 13:26:53 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p03IQqO4023535; Mon, 3 Jan 2011 13:26:52 -0500 Received: from moof.tlv.redhat.com (dhcp-1-185.tlv.redhat.com [10.35.1.185]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p03IQeWa027298; Mon, 3 Jan 2011 13:26:51 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 08/17] KVM test: let kvm_vm.create_image() raise a CmdError if qemu-img fails Date: Mon, 3 Jan 2011 20:27:09 +0200 Message-Id: <1294079238-21239-8-git-send-email-mgoldish@redhat.com> In-Reply-To: <1294079238-21239-1-git-send-email-mgoldish@redhat.com> References: <1294079238-21239-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 18:26:58 +0000 (UTC) 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