Skip to content

Commit

Permalink
Issue #181: Re-compile the Pillar after establishing the connection
Browse files Browse the repository at this point in the history
Solves #181.
  • Loading branch information
mirceaulinic committed Oct 28, 2020
1 parent 6376151 commit f4bf452
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions salt_sproxy/_runners/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,16 @@ def gen_modules(self, initial_load=False): # pylint: disable=arguments-differ
# may contain other grains from different sources, e.g., roster.
loaded_grains = salt.loader.grains(self.opts, proxy=self.proxy)
self.opts['grains'] = salt.utils.dictupdate.merge(grains, loaded_grains)
if self.opts.get('proxy_load_pillar', True):
self.opts['pillar'] = salt.pillar.get_pillar(
self.opts,
self.opts['grains'],
self.opts['id'],
saltenv=self.opts['saltenv'],
pillarenv=self.opts.get('pillarenv'),
).compile_pillar()
self.functions.pack['__grains__'] = copy.deepcopy(self.opts['grains'])
self.functions.pack['__pillar__'] = copy.deepcopy(self.opts['pillar'])
self.grains_cache = copy.deepcopy(self.opts['grains'])

if self.opts.get('invasive_targeting', False):
Expand Down

0 comments on commit f4bf452

Please sign in to comment.