fix: validate required url/path fields in get_sources

This commit is contained in:
2026-03-17 20:22:52 -04:00
parent 90aaf8f80c
commit b7fba8ab5e
+4
View File
@@ -34,8 +34,12 @@ def get_sources(ansible_cfg: dict) -> list[dict]:
for src in sources:
src_type = src.get("type", "local")
if src_type == "git":
if not src.get("url"):
raise ValueError(f"Ansible git source {src['name']!r} is missing required 'url' field")
path = str(Path(cache_dir) / src["name"])
else:
if not src.get("path"):
raise ValueError(f"Ansible local source {src['name']!r} is missing required 'path' field")
path = src.get("path", "")
result.append({
"name": src["name"],