Improve error/warning messages w.r.t. YAML quoting (#1205)

* Remove superfluous conversions/assignments.

* Improve messages.
This commit is contained in:
Felix Fontein
2025-11-16 12:32:51 +01:00
committed by GitHub
parent e42423b949
commit c61c0e24b8
8 changed files with 35 additions and 21 deletions
+4 -2
View File
@@ -914,8 +914,10 @@ def get_docker_environment(
for name, value in env.items():
if not isinstance(value, str):
raise ValueError(
"Non-string value found for env option. "
f"Ambiguous env options must be wrapped in quotes to avoid YAML parsing. Key: {name}"
"Non-string value found for env option. Ambiguous env options must be "
"wrapped in quotes to avoid them being interpreted when directly specified "
"in YAML, or explicitly converted to strings when the option is templated. "
f"Key: {name}"
)
env_dict[name] = str(value)
elif env is not None and isinstance(env, list):