Old-style proxymodules need to be setup earlier in minion init. Also include more correct comments in config.py

This commit is contained in:
C. R. Oldham 2016-03-16 20:53:26 -06:00
parent 9ab4d6164b
commit c68b968403
3 changed files with 8 additions and 6 deletions

View file

@ -1237,10 +1237,10 @@ DEFAULT_PROXY_MINION_OPTS = {
'log_file': os.path.join(salt.syspaths.LOGS_DIR, 'proxy'),
'add_proxymodule_to_opts': True,
# Default multiprocessing to False since anything that needs
# salt.vt will have trouble with our forking model.
# Multiprocessing needs to be False for any proxy that needs
# salt.vt (e.g. ssh-based proxies)
# Proxies with non-persistent (mostly REST API) connections
# can change this back to True
# can leave this at True
'multiprocessing': True
}

1
salt/config/.#__init__.py Symbolic link
View file

@ -0,0 +1 @@
cro@cro-mbp.home.ncbt.org.62688

View file

@ -2604,6 +2604,10 @@ class ProxyMinion(Minion):
# Then load the proxy module
self.proxy = salt.loader.proxy(self.opts)
# Check config 'add_proxymodule_to_opts' Remove this in Boron.
if self.opts['add_proxymodule_to_opts']:
self.opts['proxymodule'] = self.proxy
# And re-load the modules so the __proxy__ variable gets injected
self.functions, self.returners, self.function_errors = self._load_modules(proxy=self.proxy)
self.functions.pack['__proxy__'] = self.proxy
@ -2627,9 +2631,6 @@ class ProxyMinion(Minion):
# functions here, and then force a grains sync in modules_refresh
self.opts['grains'] = salt.loader.grains(self.opts, force_refresh=True)
# Check config 'add_proxymodule_to_opts' Remove this in Boron.
if self.opts['add_proxymodule_to_opts']:
self.opts['proxymodule'] = self.proxy
self.serial = salt.payload.Serial(self.opts)
self.mod_opts = self._prep_mod_opts()