From 191a089be910cc8b3b33f8733348120a9ec533c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mr=C3=A1zek?= <ales.mrazek@nic.cz>
Date: Fri, 24 Mar 2023 15:35:12 +0100
Subject: [PATCH] manager: datamodel: minor repairs/changes

---
 manager/knot_resolver_manager/datamodel/config_schema.py    | 4 ++--
 .../knot_resolver_manager/datamodel/templates/config.lua.j2 | 6 +++---
 manager/knot_resolver_manager/datamodel/view_schema.py      | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/manager/knot_resolver_manager/datamodel/config_schema.py b/manager/knot_resolver_manager/datamodel/config_schema.py
index a510c45d8..fafb00c3c 100644
--- a/manager/knot_resolver_manager/datamodel/config_schema.py
+++ b/manager/knot_resolver_manager/datamodel/config_schema.py
@@ -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
 
diff --git a/manager/knot_resolver_manager/datamodel/templates/config.lua.j2 b/manager/knot_resolver_manager/datamodel/templates/config.lua.j2
index 8d72c624d..aa700d06e 100644
--- a/manager/knot_resolver_manager/datamodel/templates/config.lua.j2
+++ b/manager/knot_resolver_manager/datamodel/templates/config.lua.j2
@@ -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" %}
diff --git a/manager/knot_resolver_manager/datamodel/view_schema.py b/manager/knot_resolver_manager/datamodel/view_schema.py
index 5732616e8..1af397785 100644
--- a/manager/knot_resolver_manager/datamodel/view_schema.py
+++ b/manager/knot_resolver_manager/datamodel/view_schema.py
@@ -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:
-- 
GitLab