diff --git a/bootstrapvz/common/tasks/host.py b/bootstrapvz/common/tasks/host.py index 075a912..412e226 100644 --- a/bootstrapvz/common/tasks/host.py +++ b/bootstrapvz/common/tasks/host.py @@ -9,14 +9,14 @@ class CheckExternalCommands(Task): @classmethod def run(cls, info): - from ..tools import log_check_call - from subprocess import CalledProcessError import re + import logging + from distutils.spawn import find_executable missing_packages = [] + log = logging.getLogger(__name__) for command, package in info.host_dependencies.items(): - try: - log_check_call(['type', command], shell=True) - except CalledProcessError: + log.debug('Checking availability of ' + command) + if find_executable(command) is None: if re.match('^https?:\/\/', package): msg = ('The command `{command}\' is not available, ' 'you can download the software at `{package}\'.'