Merge pull request #40047 from rallytime/bp-40000

Back-port #40000 to 2016.11
This commit is contained in:
Nicole Thomas 2017-03-15 11:47:36 -06:00 committed by GitHub
commit 4067625676

View file

@ -36,10 +36,13 @@ def get_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None,
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opts.get('master_type') == 'disable' and file_client == 'remote':
file_client = 'local'
ptype = {
'remote': RemotePillar,
'local': Pillar
}.get(opts['file_client'], Pillar)
}.get(file_client, Pillar)
# If local pillar and we're caching, run through the cache system first
log.debug('Determining pillar cache')
if opts['pillar_cache']:
@ -57,10 +60,13 @@ def get_async_pillar(opts, grains, minion_id, saltenv=None, ext=None, funcs=None
'''
Return the correct pillar driver based on the file_client option
'''
file_client = opts['file_client']
if opts.get('master_type') == 'disable' and file_client == 'remote':
file_client = 'local'
ptype = {
'remote': AsyncRemotePillar,
'local': AsyncPillar,
}.get(opts['file_client'], AsyncPillar)
}.get(file_client, AsyncPillar)
return ptype(opts, grains, minion_id, saltenv, ext, functions=funcs,
pillar=pillar, pillarenv=pillarenv)