Merge pull request #46185 from terminalmage/issue46124

gitfs: Fix detection of base env when its ref is also mapped to a different env
This commit is contained in:
Nicole Thomas 2018-02-26 09:52:15 -05:00 committed by GitHub
commit 390d592aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1982,6 +1982,9 @@ class GitBase(object):
for saltenv, saltenv_conf in six.iteritems(repo_obj.saltenv): for saltenv, saltenv_conf in six.iteritems(repo_obj.saltenv):
if 'ref' in saltenv_conf: if 'ref' in saltenv_conf:
ref = saltenv_conf['ref'] ref = saltenv_conf['ref']
repo_obj.saltenv_revmap.setdefault(
ref, []).append(saltenv)
if saltenv == 'base': if saltenv == 'base':
# Remove redundant 'ref' config for base saltenv # Remove redundant 'ref' config for base saltenv
repo_obj.saltenv[saltenv].pop('ref') repo_obj.saltenv[saltenv].pop('ref')
@ -1996,9 +1999,6 @@ class GitBase(object):
) )
# Rewrite 'base' config param # Rewrite 'base' config param
repo_obj.base = ref repo_obj.base = ref
else:
repo_obj.saltenv_revmap.setdefault(
ref, []).append(saltenv)
# Build list of all envs defined by ref mappings in the # Build list of all envs defined by ref mappings in the
# per-remote 'saltenv' param. We won't add any matching envs # per-remote 'saltenv' param. We won't add any matching envs