From: Petr Špaček Date: Fri, 24 Jun 2022 12:06:39 +0000 (+0200) Subject: Add zone definitions into the view grammar X-Git-Tag: v9.19.3~16^2~12 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=435cbb61bad65bcef7fa13d47d5b5789e7106846;p=thirdparty%2Fbind9.git Add zone definitions into the view grammar I cannot see a reasonable way to achieve this without the hack in this commit. --- diff --git a/doc/arm/_ext/iscconf.py b/doc/arm/_ext/iscconf.py index c4252c4202e..022d303de06 100644 --- a/doc/arm/_ext/iscconf.py +++ b/doc/arm/_ext/iscconf.py @@ -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[:] diff --git a/doc/arm/_ext/mergegrammar.py b/doc/arm/_ext/mergegrammar.py index d339da1645f..75146f7dc4b 100644 --- a/doc/arm/_ext/mergegrammar.py +++ b/doc/arm/_ext/mergegrammar.py @@ -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