mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix fileserver backends __opts__ overwritten by _pillar
This commit is contained in:
parent
2e09789156
commit
5f451f63cf
@ -306,6 +306,12 @@ class Fileserver(object):
|
||||
'''
|
||||
return self.opts
|
||||
|
||||
def update_opts(self):
|
||||
# This fix func monkey patching by pillar
|
||||
for name, func in self.servers.items():
|
||||
if '__opts__' in func.func_globals:
|
||||
func.func_globals['__opts__'].update(self.opts)
|
||||
|
||||
def clear_cache(self, back=None):
|
||||
'''
|
||||
Clear the cache of all of the fileserver backends that support the
|
||||
|
@ -768,14 +768,14 @@ class AESFuncs(object):
|
||||
'''
|
||||
Set the local file objects from the file server interface
|
||||
'''
|
||||
fs_ = salt.fileserver.Fileserver(self.opts)
|
||||
self._serve_file = fs_.serve_file
|
||||
self._file_hash = fs_.file_hash
|
||||
self._file_list = fs_.file_list
|
||||
self._file_list_emptydirs = fs_.file_list_emptydirs
|
||||
self._dir_list = fs_.dir_list
|
||||
self._symlink_list = fs_.symlink_list
|
||||
self._file_envs = fs_.envs
|
||||
self.fs_ = salt.fileserver.Fileserver(self.opts)
|
||||
self._serve_file = self.fs_.serve_file
|
||||
self._file_hash = self.fs_.file_hash
|
||||
self._file_list = self.fs_.file_list
|
||||
self._file_list_emptydirs = self.fs_.file_list_emptydirs
|
||||
self._dir_list = self.fs_.dir_list
|
||||
self._symlink_list = self.fs_.symlink_list
|
||||
self._file_envs = self.fs_.envs
|
||||
|
||||
def __verify_minion(self, id_, token):
|
||||
'''
|
||||
@ -1104,6 +1104,7 @@ class AESFuncs(object):
|
||||
load.get('ext'),
|
||||
self.mminion.functions)
|
||||
data = pillar.compile_pillar(pillar_dirs=pillar_dirs)
|
||||
self.fs_.update_opts()
|
||||
if self.opts.get('minion_data_cache', False):
|
||||
cdir = os.path.join(self.opts['cachedir'], 'minions', load['id'])
|
||||
if not os.path.isdir(cdir):
|
||||
|
Loading…
Reference in New Issue
Block a user