mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
add a __virtual__ to check that daemontools is installed properly
This commit is contained in:
parent
623935a1bc
commit
4237c5db80
1 changed files with 7 additions and 0 deletions
|
@ -21,6 +21,7 @@ import os.path
|
|||
import re
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
from salt.exceptions import CommandExecutionError
|
||||
|
||||
# Function alias to not shadow built-ins.
|
||||
|
@ -42,6 +43,12 @@ for service_dir in VALID_SERVICE_DIRS:
|
|||
break
|
||||
|
||||
|
||||
def __virtual__():
|
||||
# Ensure that daemontools is installed properly.
|
||||
BINS = {'svc', 'supervise', 'svok'}
|
||||
return all(salt.utils.which(bin) for bin in BINS)
|
||||
|
||||
|
||||
def _service_path(name):
|
||||
'''
|
||||
build service path
|
||||
|
|
Loading…
Add table
Reference in a new issue