mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix loader call in pyobjects
This commit is contained in:
parent
4cbef0f7e4
commit
1aab1bde56
@ -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):
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user