From acb17a98d03d82c82cee5c668ecd46cd5497a3e4 Mon Sep 17 00:00:00 2001 From: Brendan Harley Date: Sun, 2 Jul 2017 17:16:25 +0200 Subject: [PATCH] Add executable check to find_executable Find_executable returns a file in the path, so it must be checked for executability. --- bootstrapvz/common/tasks/host.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/common/tasks/host.py b/bootstrapvz/common/tasks/host.py index 412e226..73d7d3d 100644 --- a/bootstrapvz/common/tasks/host.py +++ b/bootstrapvz/common/tasks/host.py @@ -10,13 +10,15 @@ class CheckExternalCommands(Task): @classmethod def run(cls, info): import re + import os import logging from distutils.spawn import find_executable missing_packages = [] log = logging.getLogger(__name__) for command, package in info.host_dependencies.items(): log.debug('Checking availability of ' + command) - if find_executable(command) is None: + path = find_executable(command) + if path is None or not os.access(path, os.X_OK): if re.match('^https?:\/\/', package): msg = ('The command `{command}\' is not available, ' 'you can download the software at `{package}\'.'