mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix for __env__ in legacy git_pillar
When the __env__ branch is used, the branch needs to be checked out late. Failing to do so, an old version of the pillar (or even an empty version) will be used.
This commit is contained in:
parent
87d86e4b3e
commit
d46e09afc6
1 changed files with 5 additions and 3 deletions
|
@ -388,9 +388,9 @@ def _legacy_git_pillar(minion_id, repo_string, pillar_dirs):
|
|||
log.warning('Unrecognized extra parameter: {0}'.format(key))
|
||||
|
||||
# environment is "different" from the branch
|
||||
branch, _, environment = branch_env.partition(':')
|
||||
cfg_branch, _, environment = branch_env.partition(':')
|
||||
|
||||
gitpil = _LegacyGitPillar(branch, repo_location, __opts__)
|
||||
gitpil = _LegacyGitPillar(cfg_branch, repo_location, __opts__)
|
||||
branch = gitpil.branch
|
||||
|
||||
if environment == '':
|
||||
|
@ -404,7 +404,9 @@ def _legacy_git_pillar(minion_id, repo_string, pillar_dirs):
|
|||
|
||||
pillar_dirs.setdefault(pillar_dir, {})
|
||||
|
||||
if pillar_dirs[pillar_dir].get(branch, False):
|
||||
if cfg_branch == '__env__' and branch not in ['master', 'base']:
|
||||
gitpil.update()
|
||||
elif pillar_dirs[pillar_dir].get(branch, False):
|
||||
return {} # we've already seen this combo
|
||||
|
||||
pillar_dirs[pillar_dir].setdefault(branch, True)
|
||||
|
|
Loading…
Add table
Reference in a new issue