From 4e881bbfec5045365fcaf2eb99e1aa06a68d74e3 Mon Sep 17 00:00:00 2001 From: Colton Myers Date: Fri, 20 Mar 2015 10:14:40 -0600 Subject: [PATCH 1/2] Clean the __pub kwargs for saltutil.runner --- salt/modules/saltutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/modules/saltutil.py b/salt/modules/saltutil.py index bef3487d77..739b3ff2bd 100644 --- a/salt/modules/saltutil.py +++ b/salt/modules/saltutil.py @@ -750,6 +750,8 @@ def runner(fun, **kwargs): salt '*' saltutil.runner jobs.list_jobs ''' + kwargs = salt.utils.clean_kwargs(**kwargs) + rclient = salt.runner.RunnerClient(__opts__) return rclient.cmd(fun, [], kwarg=kwargs) From 3f0b003c7a3353445cdd1fd7b6c48c2df2b89438 Mon Sep 17 00:00:00 2001 From: Colton Myers Date: Fri, 20 Mar 2015 10:28:48 -0600 Subject: [PATCH 2/2] Generate master config if it's not present --- salt/modules/saltutil.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/salt/modules/saltutil.py b/salt/modules/saltutil.py index 739b3ff2bd..0ece8d0919 100644 --- a/salt/modules/saltutil.py +++ b/salt/modules/saltutil.py @@ -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 @@ -752,7 +753,14 @@ def runner(fun, **kwargs): ''' kwargs = salt.utils.clean_kwargs(**kwargs) - rclient = salt.runner.RunnerClient(__opts__) + 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)