mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Add executable check to find_executable
Find_executable returns a file in the path, so it must be checked for executability.
This commit is contained in:
parent
df3a200df3
commit
acb17a98d0
1 changed files with 3 additions and 1 deletions
|
@ -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}\'.'
|
||||
|
|
Loading…
Add table
Reference in a new issue