File 0047-Old-style-proxymodules-need-to-be-setup-earlier-in-m.patch of Package salt.3314
From e4d5b5e8519e1f55621d96f6167d2c0c7ceab03d Mon Sep 17 00:00:00 2001
From: "C. R. Oldham" <cro@ncbt.org>
Date: Wed, 16 Mar 2016 20:53:26 -0600
Subject: [PATCH 47/47] Old-style proxymodules need to be setup earlier in
minion init. Also include more correct comments in config.py
---
salt/config.py | 6 +++---
salt/config/.#__init__.py | 1 +
salt/minion.py | 7 ++++---
3 files changed, 8 insertions(+), 6 deletions(-)
create mode 120000 salt/config/.#__init__.py
diff --git a/salt/config.py b/salt/config.py
index b191047..f25b888 100644
--- a/salt/config.py
+++ b/salt/config.py
@@ -1218,10 +1218,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
}
diff --git a/salt/config/.#__init__.py b/salt/config/.#__init__.py
new file mode 120000
index 0000000..e6d16d6
--- /dev/null
+++ b/salt/config/.#__init__.py
@@ -0,0 +1 @@
+cro@cro-mbp.home.ncbt.org.62688
\ No newline at end of file
diff --git a/salt/minion.py b/salt/minion.py
index 5a9be8c..170de10 100644
--- a/salt/minion.py
+++ b/salt/minion.py
@@ -2591,6 +2591,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
@@ -2614,9 +2618,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()
--
2.8.1