summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs
diff options
context:
space:
mode:
authorJames Harris <james.harris@garmin.com>2019-08-22 15:09:36 -0500
committerJames Harris <james.harris@garmin.com>2019-11-05 23:33:57 -0600
commit8c19ca0cd20a1b039c15c70bb313a07d5784ddd1 (patch)
treed954077d9cb7b235b84139a4ffb84ccb40c9b457 /jenkins_jobs
parentb27399c477e5d5331c59aa341b734f5901a7fffe (diff)
downloadpython-jenkins-job-builder-8c19ca0cd20a1b039c15c70bb313a07d5784ddd1.tar.gz
python-jenkins-job-builder-8c19ca0cd20a1b039c15c70bb313a07d5784ddd1.tar.xz
python-jenkins-job-builder-8c19ca0cd20a1b039c15c70bb313a07d5784ddd1.zip
Fix double inderection of name templates
Ensure that we can resolve any lazily loaded templates that might be dictionary keys in yaml. For more informmation please see the added test case in tests/yamlparser/fixtures/jinja-string04.yaml. Change-Id: I67fbca422f2165729af15e4d039278ad66f6240b Story: 2006431 Task: 36338
Diffstat (limited to 'jenkins_jobs')
-rw-r--r--jenkins_jobs/formatter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/jenkins_jobs/formatter.py b/jenkins_jobs/formatter.py
index 61596780..470646f0 100644
--- a/jenkins_jobs/formatter.py
+++ b/jenkins_jobs/formatter.py
@@ -59,9 +59,9 @@ def deep_format(obj, paramdict, allow_empty=False):
ret = type(obj)()
for item in obj:
try:
- ret[
- CustomFormatter(allow_empty).format(item, **paramdict)
- ] = deep_format(obj[item], paramdict, allow_empty)
+ ret[deep_format(item, paramdict, allow_empty)] = deep_format(
+ obj[item], paramdict, allow_empty
+ )
except KeyError as exc:
missing_key = exc.args[0]
desc = "%s parameter missing to format %s\nGiven:\n%s" % (