From 2ef7aaf195486c3b066f193a4c51c71ef5d1654b Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 25 Jul 2024 16:14:29 -0700 Subject: [PATCH] Allow "None" for maximum age in config --- domain/config/ConfigFile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/domain/config/ConfigFile.py b/domain/config/ConfigFile.py index 8abdf8f..c40b3d4 100644 --- a/domain/config/ConfigFile.py +++ b/domain/config/ConfigFile.py @@ -156,10 +156,11 @@ class ConfigFile: maximum_age = options["maximum-age"] self.info(f"Found maximum-age option (max age in days): {maximum_age}") - assert isinstance(maximum_age, int), ( - f"Option maximum-age must be int, but got: {maximum_age}" + assert maximum_age is None or isinstance(maximum_age, int), ( + f"Option maximum-age must be None or an integer," + f" but got: {type(maximum_age).__name__} ({maximum_age})" ) - assert maximum_age > 0, ( + assert maximum_age is None or maximum_age > 0, ( f"Option maximum-age is zero, which doesn't make sense." ) self.__maximum_age = maximum_age