From 61ede82f3655ad5d257634fbb69bfb9aaea077d9 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 15:13:49 +0000 Subject: [PATCH] default values for lists in SETTINGS --- kiwi_simple_metrics/settings/metric.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kiwi_simple_metrics/settings/metric.py b/kiwi_simple_metrics/settings/metric.py index d1b5b68..9b3f71b 100644 --- a/kiwi_simple_metrics/settings/metric.py +++ b/kiwi_simple_metrics/settings/metric.py @@ -1,8 +1,8 @@ import math from typing import Any, Literal -from pydantic import (BaseModel, DirectoryPath, Field, FieldValidationInfo, - FilePath, field_validator) +from pydantic import (BaseModel, DirectoryPath, FieldValidationInfo, FilePath, + field_validator) class MetricSettings(BaseModel): @@ -81,7 +81,7 @@ class DiskMS(MetricSettings): count: int | None = 1 # paths to check for disk space - paths: list[DirectoryPath] = Field(default_factory=list) + paths: list[DirectoryPath] = [DirectoryPath("/")] class ExternalMS(MetricSettings): @@ -89,7 +89,7 @@ class ExternalMS(MetricSettings): threshold: float = 0 # path to executable files - executables: list[FilePath] = Field(default_factory=list) + executables: list[FilePath] = [] # wait at most this many seconds for each executable timeout: int = 60