jenkins-job-builder/tests/localyaml
Adam Romanek aa5d6a538d Fix retaining anchors when using with !j2-yaml
Before this change using an anchor/alias in !j2-yaml resulted in an
exception, even if retain_anchors was set to True:

>      File "(...)/jenkins-job-builder/.tox/py38/lib/python3.8/site-packages/yaml/composer.py", line 68, in compose_node
>    raise ComposerError(None, None, "found undefined alias %r"
>    yaml.composer.ComposerError: found undefined alias '<alias-name-xxx>'

The reason was that LateYamlLoader.get_object_to_format() was calling
load() without retain_anchors=True so effectively it was resetting
anchors during deep formatting...

From now on yaml.load() is called directly to avoid unwanted
side-effects of load() which is meant to be called from other modules,
typically by parser.YamlParser().

Change-Id: I0fde43c5c27ddf78f18dc244d8dba5bd768306b7
2021-04-01 14:57:55 +02:00
..
fixtures Fix retaining anchors when using with !j2-yaml 2021-04-01 14:57:55 +02:00
__init__.py Use yaml local tags to support including files 2014-06-20 23:16:23 +01:00
test_localyaml.py Fix retaining anchors when using with !j2-yaml 2021-04-01 14:57:55 +02:00