mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +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
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
missing_packages = []
|
missing_packages = []
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
for command, package in info.host_dependencies.items():
|
for command, package in info.host_dependencies.items():
|
||||||
log.debug('Checking availability of ' + command)
|
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):
|
if re.match('^https?:\/\/', package):
|
||||||
msg = ('The command `{command}\' is not available, '
|
msg = ('The command `{command}\' is not available, '
|
||||||
'you can download the software at `{package}\'.'
|
'you can download the software at `{package}\'.'
|
||||||
|
|
Loading…
Add table
Reference in a new issue