Merge pull request #28282 from keesbos/git-pillar-env-fix

Fix for __env__ in legacy git_pillar
This commit is contained in:
Colton Myers 2015-10-26 15:20:25 -06:00
commit 2f2f51906d

View file

@ -397,9 +397,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 == '':
@ -413,7 +413,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)