gitfs: Fix detection of base env when its ref is also mapped to a different env

This commit is contained in:
Erik Johnson 2018-02-25 11:46:38 -06:00
parent 705caa8cca
commit 3b58dd0da0
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

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