diff --git a/tests/lint/filesystem/test_yaml_syntax.py b/tests/lint/filesystem/test_yaml_syntax.py index c863e6626e..d3df4afdc9 100644 --- a/tests/lint/filesystem/test_yaml_syntax.py +++ b/tests/lint/filesystem/test_yaml_syntax.py @@ -23,10 +23,7 @@ class TestYamlSyntax(unittest.TestCase): invalid.append((full, f"Unexpected error: {e}")) if invalid: - msg_lines = [ - f"{path}: {err.splitlines()[0]}" # just the first line of the error - for path, err in invalid - ] + msg_lines = [f"{path}: {err.splitlines()[0]}" for path, err in invalid] self.fail( "Found invalid YAML in the following files:\n" + "\n".join(msg_lines) ) diff --git a/utils/cache/yaml.py b/utils/cache/yaml.py index 42d300e890..c801ba4bfe 100644 --- a/utils/cache/yaml.py +++ b/utils/cache/yaml.py @@ -50,6 +50,13 @@ def _construct_compose_merge_tag(loader, node): for _tag in ("!override", "!reset"): yaml.SafeLoader.add_constructor(_tag, _construct_compose_merge_tag) + +def _construct_vault_tag(loader, node): + return loader.construct_scalar(node) + + +yaml.SafeLoader.add_constructor("!vault", _construct_vault_tag) + _MISSING = object() _CACHE: dict[tuple[str, int, int], list[Any]] = {}