fix(map): reject a zones layer without a deployment section
The README documents deployment as required when zones exist, but load_map only enforced the reverse direction (deployment without zones). A map with a zones layer and no deployment now fails with MapValidationError instead of loading with unreachable deployment zones.
This commit is contained in:
@@ -131,6 +131,13 @@ def _check_deployment(
|
||||
deployment: dict[str, str], zones: tuple[str, ...] | None, path: Path
|
||||
) -> None:
|
||||
if not deployment:
|
||||
if zones is not None:
|
||||
msg = (
|
||||
"zones layer declared but no deployment section (the README "
|
||||
"requires deployment when zones exist: each zone letter needs "
|
||||
"a side)"
|
||||
)
|
||||
raise MapValidationError(path, msg)
|
||||
return
|
||||
if zones is None:
|
||||
msg = "deployment declared but no zones layer"
|
||||
|
||||
Reference in New Issue
Block a user