add more documentation for new function

This commit is contained in:
Daniel Wallace 2018-05-19 21:14:40 -05:00
parent ce2dae8892
commit b12f80712b
No known key found for this signature in database
GPG Key ID: 5FA5E5544F010D48
5 changed files with 20 additions and 3 deletions

View File

@ -11,5 +11,6 @@ executors modules
:template: autosummary.rst.tmpl
direct_call
docker
splay
sudo

View File

@ -0,0 +1,6 @@
salt.executors.docker module
============================
.. automodule:: salt.executors.docker
:members:

View File

@ -83,3 +83,7 @@ option set by commandline or API ``data.get('executor_opts',
{}).get('splaytime')`` should be used. So if an option is safe and must be
accessible by user executor should check it in both places, but if an option is
unsafe it should be read from the only config ignoring the passed request data.
There is also a function named ``all_missing_func`` which the name of the
``func`` is passed, which can be used to verify if the command should still be
run, even if it is not loaded in minion_mods.

View File

@ -36,5 +36,11 @@ def execute(opts, data, func, args, kwargs):
return __salt__['docker.call'](opts['proxy']['name'], data['fun'], *args, **kwargs)
def allow_missing_funcs():
def allow_missing_func(function): # pylint: disable=unused-argument
'''
Allow all calls to be passed through to docker container.
The docker call will use direct_call, which will return back if the module
was unable to be run.
'''
return True

View File

@ -1569,9 +1569,9 @@ class Minion(MinionBase):
getattr(minion_instance, 'module_executors', []) or \
opts.get('module_executors', ['direct_call'])
allow_missing_funcs = any([
minion_instance.executors['{0}.allow_missing_funcs'.format(executor)]()
minion_instance.executors['{0}.allow_missing_func'.format(executor)](function_name)
for executor in executors
if '{0}.allow_missing_funcs' in minion_instance.executors
if '{0}.allow_missing_func' in minion_instance.executors
])
if function_name in minion_instance.functions or allow_missing_funcs is True:
try: