[substitutions] Fix #7189 (#9469)

This commit is contained in:
Javier Peletier
2025-07-14 09:58:52 +12:00
committed by GitHub
parent 9451781915
commit 9e002cd7a3
5 changed files with 11 additions and 2 deletions
+5 -2
View File
@@ -146,8 +146,11 @@ def _substitute_item(substitutions, item, path, jinja, ignore_missing):
if sub is not None:
item[k] = sub
for old, new in replace_keys:
item[new] = merge_config(item.get(old), item.get(new))
del item[old]
if str(new) == str(old):
item[new] = item[old]
else:
item[new] = merge_config(item.get(old), item.get(new))
del item[old]
elif isinstance(item, str):
sub = _expand_substitutions(substitutions, item, path, jinja, ignore_missing)
if isinstance(sub, JinjaStr) or sub != item: