Skip to content
Snippets Groups Projects
Commit 191a089b authored by Aleš Mrázek's avatar Aleš Mrázek
Browse files

manager: datamodel: minor repairs/changes

parent d27f5c94
Branches
Tags
1 merge request!1313manager: datamodel improvements
......@@ -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
......
......@@ -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" %}
......
......@@ -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:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment