mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't incur a "_load_all" of the lazy_loader while looking for mod_init.
Since we were checking if mod_init is in the loader dict-- and we still allow for module merging (#20540) we will do a load_all for every module without mod_init. This patch makes it so we load w/e module the function is in, then check if we have loaded a mod_init. This cuts out ~600ms on my local simple state.sls runs
This commit is contained in:
parent
4c5a708599
commit
be18439736
1 changed files with 3 additions and 1 deletions
|
@ -608,9 +608,11 @@ class State(object):
|
|||
of a state package that has a mod_init function, then execute the
|
||||
mod_init function in the state module.
|
||||
'''
|
||||
# ensure that the module is loaded
|
||||
self.states['{0}.{1}'.format(low['state'], low['fun'])]
|
||||
minit = '{0}.mod_init'.format(low['state'])
|
||||
if low['state'] not in self.mod_init:
|
||||
if minit in self.states:
|
||||
if minit in self.states._dict:
|
||||
mret = self.states[minit](low)
|
||||
if not mret:
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue