2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +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
No known key found for this signature in database
GPG Key ID: ABD587CDF06581AE
2 changed files with 10 additions and 3 deletions

View File

@ -145,8 +145,11 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
try:
zone_idx = path.index("zone")
zone_type_txt = path[zone_idx + 1]
assert zone_type_txt.startswith("type "), zone_type_txt
zone_types.add(zone_type_txt[len("type ") :])
if zone_type_txt.startswith("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):
nozone_paths.append(path)
condensed_paths = nozone_paths[:]

View File

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