From 3b58dd0da0f5ec2f5bfed54d0d87251b3a24ed36 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Sun, 25 Feb 2018 11:46:38 -0600 Subject: [PATCH] gitfs: Fix detection of base env when its ref is also mapped to a different env --- salt/utils/gitfs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index fb8143a409..5f1d30b1f4 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -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