From patchwork Thu Jan 6 20:21:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 460441 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 p06KLBj7002598 for ; Thu, 6 Jan 2011 20:21:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695Ab1AFUVH (ORCPT ); Thu, 6 Jan 2011 15:21:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52257 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564Ab1AFUVF (ORCPT ); Thu, 6 Jan 2011 15:21:05 -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 p06KL4vB018859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Jan 2011 15:21:04 -0500 Received: from freedom.redhat.com (vpn-10-201.rdu.redhat.com [10.11.10.201]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p06KL2sA019626; Thu, 6 Jan 2011 15:21:03 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] unattended.py: Make sure qemu-img built from git is used Date: Thu, 6 Jan 2011 18:21:00 -0200 Message-Id: <1294345260-11586-1-git-send-email-lmr@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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 20:21:11 +0000 (UTC) diff --git a/client/tests/kvm/scripts/unattended.py b/client/tests/kvm/scripts/unattended.py index e9e4751..61c3326 100755 --- a/client/tests/kvm/scripts/unattended.py +++ b/client/tests/kvm/scripts/unattended.py @@ -24,6 +24,8 @@ def find_command(cmd): @param cmd: Command to be found. """ + if os.path.exists(cmd): + return cmd for dir in ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin"]: file = os.path.join(dir, cmd) @@ -119,9 +121,8 @@ class FloppyDisk(Disk): """ def __init__(self, path): print "Creating floppy unattended image %s" % path - try: - qemu_img_binary = os.environ['KVM_TEST_qemu_img_binary'] - except KeyError: + qemu_img_binary = os.environ['KVM_TEST_qemu_img_binary'] + if not os.path.isabs(qemu_img_binary): qemu_img_binary = os.path.join(KVM_TEST_DIR, qemu_img_binary) if not os.path.exists(qemu_img_binary): raise SetupError('The qemu-img binary that is supposed to be used '