Skip to content

Commit

Permalink
Merge pull request #194 from mirceaulinic/pillar-target
Browse files Browse the repository at this point in the history
Override pillar_target to pillar when running against running Minions
  • Loading branch information
mirceaulinic authored Nov 2, 2020
2 parents 6d238e6 + c3e573f commit d9f4055
Show file tree
Hide file tree
Showing 2 changed files with 10 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 @@ -1354,6 +1354,15 @@ def execute(
# indefinitely.
timeout = None

if tgt_type == 'pillar_target':
# When using the -I option on the CLI, the tgt_type passed on is called
# `pillar_target`:
# https://github.com/saltstack/salt/blob/e9e48b7fb6a688f4f22d74a849d58c1c156563d1/salt/utils/parsers.py#L1266
# While if we want to use this against existing Minions, the option
# needs to be just `pillar`:
# https://github.com/saltstack/salt/blob/99385b50718d70d93fd5b83e61c0f4b3a402490c/salt/utils/minions.py#L359
tgt_type = 'pillar'

if preload_targeting or invasive_targeting:
_tgt = '*'
_tgt_type = 'glob'
Expand Down
1 change: 1 addition & 0 deletions salt_sproxy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def run(self):
'grain',
'pcre',
'grain_pcre',
'pillar',
'pillar_pcre',
'pillar_target',
'nodegroup',
Expand Down

0 comments on commit d9f4055

Please sign in to comment.