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:
Thomas Jackson 2015-06-19 08:50:32 -07:00
parent 4c5a708599
commit be18439736

View file

@ -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