mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #21849 from basepi/saltutil.runner.21650
[2014.7] saltutil.runner fixes
This commit is contained in:
commit
8262d85998
@ -29,6 +29,7 @@ import salt
|
||||
import salt.payload
|
||||
import salt.state
|
||||
import salt.client
|
||||
import salt.config
|
||||
import salt.runner
|
||||
import salt.utils
|
||||
import salt.utils.process
|
||||
@ -750,7 +751,16 @@ def runner(fun, **kwargs):
|
||||
|
||||
salt '*' saltutil.runner jobs.list_jobs
|
||||
'''
|
||||
rclient = salt.runner.RunnerClient(__opts__)
|
||||
kwargs = salt.utils.clean_kwargs(**kwargs)
|
||||
|
||||
if 'master_job_cache' not in __opts__:
|
||||
master_config = os.path.join(os.path.dirname(__opts__['conf_file']),
|
||||
'master')
|
||||
master_opts = salt.config.master_config(master_config)
|
||||
rclient = salt.runner.RunnerClient(master_opts)
|
||||
else:
|
||||
rclient = salt.runner.RunnerClient(__opts__)
|
||||
|
||||
return rclient.cmd(fun, [], kwarg=kwargs)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user