Rather than what it was found on the user's PATH.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
client/tests/kvm/scripts/unattended.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
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 '
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html