only check if static_qemu is_executable()

This commit is contained in:
Alessandro -oggei- Ogier 2017-09-08 10:27:29 +02:00
parent 70642e495d
commit 51c7a1ba00
2 changed files with 12 additions and 1 deletions

View file

@ -403,7 +403,7 @@ def _bootstrap_deb(
log.error('Required tool debootstrap is not installed.')
return False
if static_qemu and not salt.utils.validate.path.is_readable(static_qemu):
if static_qemu and not salt.utils.validate.path.is_executable(static_qemu):
log.error('Required tool qemu not '
'present/readable at: {0}'.format(static_qemu))
return False

View file

@ -64,3 +64,14 @@ def is_readable(path):
# The path does not exist
return False
def is_executable(path):
'''
Check if a given path is executable by the current user.
:param path: The path to check
:returns: True or False
'''
return os.access(path, os.X_OK)