This fixes T169 and T148. It also improves T181.
As described in T169, I had to get rid of jinja, because it operates on text only,
and we need to work with objects. The variable substitutions are now done manually,
but you can now easily pass objects in the task yaml.
This also fixes variable nesting, you can now easily use variables deep in the
structure, like this:
task:
- name: run upgradepath
python:
file: upgradepath.py
callable: main
custom_args: [--debug, --bodhi-hack, "${bodhi_id}", faketag]
export: upgradepath_outputThe variable syntax changed to ${var}, because dollar is recognized by yaml
as a beginning of string. No quotes are therefore needed in most cases (quite
the opposite, they would break your non-string objects):
key: ${value}This doesn't work in YAML:
key: {{value}}because it's recognized as a dictionary start.
Please note that all our task yaml files will need to be adjusted for this
change (however, it's very simple).
This is not complete.
There was a request to support ${ var } style variables. This will requires
some changes in regular expression handling, and I'm afraid it will complicate
the code quite a bit. Patches welcome, or I can propose a patch early next week,
if requested.
Also, if this is approved, I'll also need to remove jinja from dependencies and
adjust our documentation. I haven't done that yet.
Just out of curiosity, would it not be possible to just use string's Template to replace the lines 55-66?
I might be missing something, but
would IMHO do the same thing. But as always, I might have missed something..