pass utils to the scheduler for reloading in modules

This commit is contained in:
Daniel Wallace 2018-03-13 10:58:41 -06:00
parent 0e90c8ca6f
commit 2883548e6b
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48
2 changed files with 5 additions and 3 deletions

View file

@ -2275,6 +2275,7 @@ class Minion(MinionBase):
self.opts,
self.functions,
self.returners,
utils=self.utils,
cleanup=[master_event(type='alive')])
try:

View file

@ -402,10 +402,11 @@ class Schedule(object):
pass
# an init for the singleton instance to call
def __singleton_init__(self, opts, functions, returners=None, intervals=None, cleanup=None, proxy=None):
def __singleton_init__(self, opts, functions, returners=None, intervals=None, cleanup=None, proxy=None, utils=None):
self.opts = opts
self.proxy = proxy
self.functions = functions
self.utils = utils
if isinstance(intervals, dict):
self.intervals = intervals
else:
@ -752,9 +753,9 @@ class Schedule(object):
# context data that could keep paretns connections. ZeroMQ will
# hang on polling parents connections from the child process.
if self.opts['__role'] == 'master':
self.functions = salt.loader.runner(self.opts)
self.functions = salt.loader.runner(self.opts, utils=self.utils)
else:
self.functions = salt.loader.minion_mods(self.opts, proxy=self.proxy)
self.functions = salt.loader.minion_mods(self.opts, proxy=self.proxy, utils=self.utils)
self.returners = salt.loader.returners(self.opts, self.functions, proxy=self.proxy)
ret = {'id': self.opts.get('id', 'master'),
'fun': func,