mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add config option so old-style proxymodules will keep loading
This commit is contained in:
parent
b79b6a39dd
commit
bdffb9f57b
3 changed files with 11 additions and 5 deletions
|
@ -225,7 +225,8 @@ additional-builtins=__opts__,
|
|||
__master_opts__,
|
||||
__jid_event__,
|
||||
__instance_id__,
|
||||
__salt_system_encoding__
|
||||
__salt_system_encoding__,
|
||||
__proxy__
|
||||
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
|
|
|
@ -434,6 +434,10 @@ VALID_OPTS = {
|
|||
# A master-only copy of the file_roots dictionary, used by the state compiler
|
||||
'master_roots': dict,
|
||||
|
||||
# Add the proxymodule LazyLoader object to opts. This breaks many things
|
||||
# but this was the default pre 2015.8.2. This should default to
|
||||
# False in Boron
|
||||
'add_proxymodule_to_opts': bool,
|
||||
'git_pillar_base': str,
|
||||
'git_pillar_branch': str,
|
||||
'git_pillar_env': str,
|
||||
|
@ -1184,6 +1188,7 @@ DEFAULT_MASTER_OPTS = {
|
|||
DEFAULT_PROXY_MINION_OPTS = {
|
||||
'conf_file': os.path.join(salt.syspaths.CONFIG_DIR, 'proxy'),
|
||||
'log_file': os.path.join(salt.syspaths.LOGS_DIR, 'proxy'),
|
||||
'add_proxymodule_to_opts': True
|
||||
}
|
||||
|
||||
# ----- Salt Cloud Configuration Defaults ----------------------------------->
|
||||
|
|
|
@ -2520,6 +2520,10 @@ class ProxyMinion(Minion):
|
|||
# Then load the proxy module
|
||||
self.proxy = salt.loader.proxy(self.opts)
|
||||
|
||||
# Check config 'add_proxymodule_to_opts' Default to False 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
|
||||
|
@ -2537,10 +2541,6 @@ class ProxyMinion(Minion):
|
|||
proxy_init_fn(self.opts)
|
||||
self.opts['grains'] = salt.loader.grains(self.opts)
|
||||
|
||||
# Check config 'add_proxymodule_to_opts' Remove this in Boron.
|
||||
if config['add_proxymodule_to_opts']:
|
||||
self.opts['proxymodule'] = self.proxy
|
||||
|
||||
self.serial = salt.payload.Serial(self.opts)
|
||||
self.mod_opts = self._prep_mod_opts()
|
||||
self.matcher = Matcher(self.opts, self.functions)
|
||||
|
|
Loading…
Add table
Reference in a new issue