From fe7abcaa8d64a9d60c0ac430cab780064f05ff46 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Mon, 2 Jun 2014 12:17:01 +0300
Subject: [PATCH] Use "which" to check if WinEXE is installed

The function distutils.spawn.find_executable is not available in
Ubuntu 14.04
---
 image_creator/winexe.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/image_creator/winexe.py b/image_creator/winexe.py
index b6c00bc..80bdea9 100644
--- a/image_creator/winexe.py
+++ b/image_creator/winexe.py
@@ -38,7 +38,7 @@
 import subprocess
 import time
 import signal
-import distutils
+from sh import which
 
 from image_creator.util import FatalError
 
@@ -53,7 +53,7 @@ class WinEXE:
 
     @staticmethod
     def is_installed(program='winexe'):
-        return distutils.spawn.find_executable(program) is not None
+        return which(program) is not None
 
     def __init__(self, username, password, hostname, program='winexe'):
         self._host = hostname
-- 
GitLab