Skip to content

Commit

Permalink
Old-style proxymodules need to be setup earlier in minion init. Also …
Browse files Browse the repository at this point in the history
…include more correct comments in config.py
  • Loading branch information
cro committed Mar 17, 2016
1 parent 9ab4d61 commit c68b968
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions salt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,10 +1237,10 @@
'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
}

Expand Down
1 change: 1 addition & 0 deletions salt/config/.#__init__.py
7 changes: 4 additions & 3 deletions salt/minion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,10 @@ def _post_master_init(self, master):
# 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
Expand All @@ -2627,9 +2631,6 @@ def _post_master_init(self, master):
# 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()
Expand Down

0 comments on commit c68b968

Please sign in to comment.