]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add zone definitions into the view grammar
authorPetr Špaček <pspacek@isc.org>
Fri, 24 Jun 2022 12:06:39 +0000 (14:06 +0200)
committerPetr Špaček <pspacek@isc.org>
Fri, 1 Jul 2022 06:59:23 +0000 (08:59 +0200)
I cannot see a reasonable way to achieve this without the hack in this
commit.

doc/arm/_ext/iscconf.py
doc/arm/_ext/mergegrammar.py

index c4252c4202ed509946c66e860499c9d898ee4f5d..022d303de06e2400355f4e6e79ae69119915d723 100644 (file)
@@ -133,14 +133,14 @@ def domain_factory(domainname, domainlabel, todolist, grammar):
                 return ".".join(path[1:])
 
             def format_paths(self, paths):
-                zone_types = []
+                zone_types = set()
                 nozone_paths = []
                 for path in paths:
                     try:
                         zone_idx = path.index("zone")
                         zone_type_txt = path[zone_idx + 1]
                         assert zone_type_txt.startswith("type "), zone_type_txt
-                        zone_types.append(zone_type_txt[len("type ") :])
+                        zone_types.add(zone_type_txt[len("type ") :])
                     except (ValueError, IndexError):
                         nozone_paths.append(path)
                 condensed_paths = nozone_paths[:]
index d339da1645fc66e8b5a0292898d79f3fb728e5c6..75146f7dc4b6b77d6b7d481c698feebb207c2097 100644 (file)
@@ -46,6 +46,10 @@ def combine():
     assert rest
     rest.update(zones)
 
+    # this is a terrible hack
+    # but cfg_test cannot print zone grammars inside view
+    rest["view"]["_mapbody"].update(zones)
+
     return rest