Fix loader call in pyobjects

This commit is contained in:
Mike Place 2015-06-17 10:17:47 -06:00
parent 4cbef0f7e4
commit 1aab1bde56
2 changed files with 3 additions and 10 deletions

View File

@ -291,16 +291,10 @@ def load_states():
states = {} states = {}
# the loader expects to find pillar & grain data # the loader expects to find pillar & grain data
__opts__['grains'] = __grains__ __opts__['grains'] = salt.loader.grains(__opts__)
__opts__['pillar'] = __pillar__ __opts__['pillar'] = __pillar__
lazy_funcs = salt.loader.minion_mods(__opts__)
lazy_states = salt.loader.LazyLoader( lazy_states = salt.loader.states(__opts__, lazy_funcs)
salt.loader._module_dirs(__opts__, 'states', 'states'),
__opts__,
tag='states',
pack={'__salt__': __salt__},
virtual_enable=True,
)
# TODO: some way to lazily do this? This requires loading *all* state modules # TODO: some way to lazily do this? This requires loading *all* state modules
for key, func in six.iteritems(lazy_states): for key, func in six.iteritems(lazy_states):

View File

@ -22,7 +22,6 @@ from salt.template import compile_template
from salt.utils.odict import OrderedDict from salt.utils.odict import OrderedDict
from salt.utils.pyobjects import (StateFactory, State, Registry, from salt.utils.pyobjects import (StateFactory, State, Registry,
SaltObject, InvalidFunction, DuplicateState) SaltObject, InvalidFunction, DuplicateState)
File = StateFactory('file') File = StateFactory('file')
Service = StateFactory('service') Service = StateFactory('service')