mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
only check if static_qemu is_executable()
This commit is contained in:
parent
70642e495d
commit
51c7a1ba00
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue