Merge pull request #40124 from alexbleotu/proxy_dunder_injection-gh

Proxy dunder injection gh
This commit is contained in:
Mike Place 2017-03-17 12:07:15 -06:00 committed by GitHub
commit cc69f79e26
2 changed files with 7 additions and 0 deletions

View File

@ -1559,6 +1559,10 @@ class LazyLoader(salt.utils.lazy.LazyDict):
self.loaded = True
def reload_modules(self):
self.loaded_files = set()
self._load_all()
def _apply_outputter(self, func, mod):
'''
Apply the __outputter__ variable to the functions

View File

@ -3109,6 +3109,9 @@ class ProxyMinion(Minion):
self.utils = salt.loader.utils(self.opts, proxy=self.proxy)
self.proxy.pack['__utils__'] = self.utils
# Reload all modules so all dunder variables are injected
self.proxy.reload_modules()
# Start engines here instead of in the Minion superclass __init__
# This is because we need to inject the __proxy__ variable but
# it is not setup until now.