mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix bug preventing minions from unloading custom modules.
This change no longer blindly updates the __salt__ dict for each module upon module refresh but instead rebuilds the dictionary from scratch. Refs #7691.
This commit is contained in:
parent
5abe667471
commit
3efb0a867d
@ -871,9 +871,12 @@ class Loader(object):
|
||||
# the available modules and inject the special __salt__ namespace that
|
||||
# contains these functions.
|
||||
for mod in modules:
|
||||
if not hasattr(mod, '__salt__'):
|
||||
if not hasattr(mod, '__salt__') or (
|
||||
not in_pack(pack, '__salt__') and
|
||||
not str(mod.__name__).startswith('salt.loaded.int.grain')
|
||||
):
|
||||
mod.__salt__ = funcs
|
||||
elif not in_pack(pack, '__salt__'):
|
||||
elif not in_pack(pack, '__salt__') and str(mod.__name__).startswith('salt.loaded.int.grain'):
|
||||
mod.__salt__.update(funcs)
|
||||
return funcs
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user