fix logging and CLI

This commit is contained in:
2024-01-12 17:10:44 +01:00
parent da0598be23
commit b910570d21
4 changed files with 9 additions and 23 deletions

View File

@@ -94,7 +94,7 @@ class BaseConfig:
class ListConfig(BaseConfig):
JSON_SCHEMA = {
"type": "object",
"required": ["name", "type"],
"required": ["type"],
"additionalProperties": True,
"properties": {
"type": {"enum": ["db"]},
@@ -203,7 +203,6 @@ class StorageConfig(BaseConfig):
"additionalProperties": False,
"properties": {
"type": {"type": "string"},
"name": {"type": "string"},
"directory": {"type": "string"},
"mode": {"type": "string"},
"metavar": {"type": "string"},
@@ -242,7 +241,6 @@ class NotificationConfig(BaseConfig):
"additionalProperties": False,
"properties": {
"type": {"type": "string"},
"name": {"type": "string"},
"smtp_host": {"type": "string"},
"smtp_port": {"type": "number"},
"envelope_from": {"type": "string"},
@@ -422,11 +420,9 @@ class QuarantineMilterConfig(BaseConfig):
def __init__(self, config, rec=True):
super().__init__(config)
for param in ["lists", "storages", "notifications"]:
for name, cfg in self[param].items():
if "name" not in cfg:
cfg["name"] = name
for name, cfg in self["lists"].items():
if "name" not in cfg:
cfg["name"] = name
self["lists"][name] = ListConfig(cfg)
for name, cfg in self["storages"].items():