add a __virtual__ to check that daemontools is installed properly

This commit is contained in:
Julien Cigar 2015-09-30 15:51:24 +02:00 committed by rallytime
parent 623935a1bc
commit 4237c5db80

View file

@ -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