More progress toward __proxy__

This commit is contained in:
C. R. Oldham 2015-10-06 09:50:20 -06:00
parent d337f4329e
commit 4a20d48b35
4 changed files with 5 additions and 18 deletions

View file

@ -180,7 +180,10 @@ def minion_mods(
if utils is None:
utils = {}
if proxy is None:
log.debug('minion_mods called with proxy empty')
proxy = {}
else:
log.debug('minion_mods called with proxy NOT empty')
if not whitelist:
whitelist = opts.get('whitelist_modules', None)
ret = LazyLoader(_module_dirs(opts, 'modules', 'module'),

View file

@ -2510,8 +2510,6 @@ class ProxyMinion(Minion):
fq_proxyname = self.opts['pillar']['proxy']['proxytype']
self.opts['proxy'] = self.opts['pillar']['proxy']
# We need to do this again, because we are going to throw out a lot of grains.
self.opts['grains'] = salt.loader.grains(self.opts)
self.proxy = salt.loader.proxy(self.opts)
self.functions, self.returners, self.function_errors = self._load_modules(proxy=self.proxy)
@ -2529,6 +2527,7 @@ class ProxyMinion(Minion):
proxy_init_fn = self.proxy[fq_proxyname+'.init']
proxy_init_fn(self.opts)
self.opts['grains'] = salt.loader.grains(self.opts)
# reload ?!?
self.serial = salt.payload.Serial(self.opts)
self.mod_opts = self._prep_mod_opts()

View file

@ -44,19 +44,6 @@ def get_all():
return __proxy__[proxy_fn]()
def list_():
'''
Return a list of all available services
CLI Example:
.. code-block:: bash
salt '*' service.list
'''
return get_all()
def list_():
'''
Return a list of all available services.

View file

@ -737,7 +737,7 @@ class State(object):
'''
log.info('Loading fresh modules for state activity')
self.utils = salt.loader.utils(self.opts)
self.functions = salt.loader.minion_mods(self.opts, self.state_con, utils=self.utils)
self.functions = salt.loader.minion_mods(self.opts, self.state_con, utils=self.utils, proxy=self.proxy)
if isinstance(data, dict):
if data.get('provider', False):
if isinstance(data['provider'], str):
@ -1539,8 +1539,6 @@ class State(object):
initial_ret={'full': state_func_name},
expected_extra_kws=STATE_INTERNAL_KEYWORDS
)
import pydevd
pydevd.settrace('172.16.207.1', port=65500, stdoutToServer=True, stderrToServer=True)
inject_globals = {
# Pass a copy of the running dictionary, the low state chunks and
# the current state dictionaries.