]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: datamodel: minor repairs/changes
authorAleš Mrázek <ales.mrazek@nic.cz>
Fri, 24 Mar 2023 14:35:12 +0000 (15:35 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 9 Jun 2023 11:54:07 +0000 (11:54 +0000)
manager/knot_resolver_manager/datamodel/config_schema.py
manager/knot_resolver_manager/datamodel/templates/config.lua.j2
manager/knot_resolver_manager/datamodel/view_schema.py

index a510c45d81f5b989f7afcec489f72ae34837dd7d..fafb00c3c50b4345ff27809781e7659a5efb84c7 100644 (file)
@@ -72,9 +72,9 @@ def _cpu_count() -> Optional[int]:
         return cpus
 
 
-def _default_max_worker_count() -> Optional[int]:
+def _default_max_worker_count() -> int:
     c = _cpu_count()
-    if c is not None:
+    if c:
         return c * 10
     return MAX_WORKERS
 
index 8d72c624dadcbf8b698c9c8d4e4608600845889b..aa700d06e44d79dc9f1d2f21e59e8f94546b06ca 100644 (file)
@@ -28,13 +28,13 @@ nsid.name('{{ cfg.nsid }}_' .. worker.id)
 {% include "local_data.lua.j2" %}
 
 -- SLICES section -----------------------------------
-{% include "slices.lua.j2" %}
+-- {% include "slices.lua.j2" %}
 
 -- POLICY section -----------------------------------
-{% include "policy.lua.j2" %}
+-- {% include "policy.lua.j2" %}
 
 -- RPZ section --------------------------------------
-{% include "rpz.lua.j2" %}
+-- {% include "rpz.lua.j2" %}
 
 -- FORWARD section ----------------------------
 {% include "forward.lua.j2" %}
index 5732616e857ec2453be16d2118e589df4071c4ec..1af397785811f4f47de792b213162c31b04132b1 100644 (file)
@@ -11,14 +11,14 @@ class ViewSchema(ConfigSchema):
     ---
     subnets: Identifies the client based on his subnet.
     tsig: Identifies the client based on a TSIG key name (for testing purposes, TSIG signature is not verified!).
-    tags: Tags to link with other policy rules.
     options: Configuration flags for clients identified by the view.
+    tags: Tags to link with other policy rules.
     """
 
     subnets: Optional[List[IPNetwork]] = None
     tsig: Optional[List[str]] = None
-    tags: List[IDPattern]
     options: Optional[List[PolicyFlagEnum]] = None
+    tags: Optional[List[IDPattern]] = None
 
     def _validate(self) -> None:
         if self.tsig is None and self.subnets is None: