Merge pull request #24832 from jacksontj/2015.5

Don't incur a "_load_all" of the lazy_loader while looking for mod_init.
This commit is contained in:
Mike Place 2015-06-22 09:17:09 -06:00
commit 31d4c131e9

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'])] # pylint: disable=W0106
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