mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
add more documentation for new function
This commit is contained in:
parent
ce2dae8892
commit
b12f80712b
@ -11,5 +11,6 @@ executors modules
|
||||
:template: autosummary.rst.tmpl
|
||||
|
||||
direct_call
|
||||
docker
|
||||
splay
|
||||
sudo
|
||||
|
6
doc/ref/executors/all/salt.executors.docker.rst
Normal file
6
doc/ref/executors/all/salt.executors.docker.rst
Normal file
@ -0,0 +1,6 @@
|
||||
salt.executors.docker module
|
||||
============================
|
||||
|
||||
.. automodule:: salt.executors.docker
|
||||
:members:
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user