2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Special-case zone in-view

It is not really a zone type, so let's not generate "type in-view"
anchor for it.
This commit is contained in:
Petr Špaček
2022-06-30 11:48:16 +02:00
parent 1af157eb20
commit 261bdc7358
2 changed files with 10 additions and 3 deletions

View File

@@ -145,8 +145,11 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
try: try:
zone_idx = path.index("zone") zone_idx = path.index("zone")
zone_type_txt = path[zone_idx + 1] zone_type_txt = path[zone_idx + 1]
assert zone_type_txt.startswith("type "), zone_type_txt if zone_type_txt.startswith("type "):
zone_types.add(zone_type_txt[len("type ") :]) zone_types.add(zone_type_txt[len("type ") :])
else:
assert zone_type_txt == "in-view"
zone_types.add(zone_type_txt)
except (ValueError, IndexError): except (ValueError, IndexError):
nozone_paths.append(path) nozone_paths.append(path)
condensed_paths = nozone_paths[:] condensed_paths = nozone_paths[:]

View File

@@ -22,6 +22,10 @@ import parsegrammar
def read_zone(): def read_zone():
zone_grammars = {} zone_grammars = {}
for file in Path("../misc/").glob("*.zoneopt"): for file in Path("../misc/").glob("*.zoneopt"):
# in-view is not really a zone type
if file.stem == "in-view":
zone_type = "in-view"
else:
zone_type = f"type {file.stem}" zone_type = f"type {file.stem}"
with file.open(encoding="ascii") as fp: with file.open(encoding="ascii") as fp: