From e1797f61eca031c8761652f00c712562efd06f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Sat, 2 Sep 2023 16:22:58 +0000 Subject: [PATCH] more pydantic way of forcing `SETTINGS.external.count` to `None` --- kiwi_simple_metrics/settings/metric.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kiwi_simple_metrics/settings/metric.py b/kiwi_simple_metrics/settings/metric.py index dc597b8..48b3201 100644 --- a/kiwi_simple_metrics/settings/metric.py +++ b/kiwi_simple_metrics/settings/metric.py @@ -89,14 +89,11 @@ class ExternalMS(MetricSettings): enabled: bool = False threshold: float = 0 + # always include all defined external values! + count: None = None + # path to executable files executables: list[FilePath] = [] # wait at most this many seconds for each executable timeout: int = 60 - - @field_validator("count", mode="after") - @classmethod - def force_none(cls, _) -> int | None: - """Don't accept a `count` value for the external metric!""" - return None