mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Wrap the split modules in objects, so we can avoid the attr/value ordering problem
This commit is contained in:
parent
9e000ff512
commit
aaf0069dd6
@ -231,11 +231,16 @@ def _split_module_dicts():
|
||||
|
||||
{{ salt.cmd.run('uptime') }}
|
||||
'''
|
||||
|
||||
class Container():
|
||||
''' This object allows us to set arbitrary attributes'''
|
||||
pass
|
||||
mod_dict = dict(__salt__)
|
||||
for module_func_name, mod_fun in mod_dict.items():
|
||||
mod, fun = module_func_name.split('.', 1)
|
||||
mod_dict.setdefault(mod,
|
||||
{})[fun] = mod_fun
|
||||
if mod not in mod_dict:
|
||||
mod_dict[mod] = Container()
|
||||
setattr(mod_dict[mod], fun, mod_fun)
|
||||
return mod_dict
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user