mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix loader call in pyobjects
This commit is contained in:
parent
39f088a74c
commit
6c804f0789
2 changed files with 4 additions and 11 deletions
|
@ -290,17 +290,11 @@ def load_states():
|
|||
'''
|
||||
states = {}
|
||||
|
||||
# the loader expects to find pillar & grian data
|
||||
__opts__['grains'] = __grains__
|
||||
# the loader expects to find pillar & grain data
|
||||
__opts__['grains'] = salt.loader.grains(__opts__)
|
||||
__opts__['pillar'] = __pillar__
|
||||
|
||||
lazy_states = salt.loader.LazyLoader(
|
||||
salt.loader._module_dirs(__opts__, 'states', 'states'),
|
||||
__opts__,
|
||||
tag='states',
|
||||
pack={'__salt__': __salt__},
|
||||
virtual_enable=True,
|
||||
)
|
||||
lazy_funcs = salt.loader.minion_mods(__opts__)
|
||||
lazy_states = salt.loader.states(__opts__, lazy_funcs)
|
||||
|
||||
# TODO: some way to lazily do this? This requires loading *all* state modules
|
||||
for key, func in lazy_states.iteritems():
|
||||
|
|
|
@ -18,7 +18,6 @@ from salt.template import compile_template
|
|||
from salt.utils.odict import OrderedDict
|
||||
from salt.utils.pyobjects import (StateFactory, State, Registry,
|
||||
SaltObject, InvalidFunction, DuplicateState)
|
||||
|
||||
File = StateFactory('file')
|
||||
Service = StateFactory('service')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue