From 5d9fd7e789c32657152b3795b39894973ae6203b Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Fri, 17 Oct 2025 10:48:03 -0700 Subject: [PATCH] processor: clamp: Raise if TTL arguments are not logical We must not have min TTLs that are not smaller than the max TTL. --- octodns/processor/clamp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/octodns/processor/clamp.py b/octodns/processor/clamp.py index 31c9e89..49dd241 100644 --- a/octodns/processor/clamp.py +++ b/octodns/processor/clamp.py @@ -1,6 +1,9 @@ from logging import getLogger -from octodns.processor.base import BaseProcessor +from .base import BaseProcessor, ProcessorException + +class TTLArgumentException(ProcessorException): + pass class TtlClampProcessor(BaseProcessor): @@ -33,6 +36,8 @@ class TtlClampProcessor(BaseProcessor): self.log = getLogger( f'{self.__class__.__module__}.{self.__class__.__name__}' ) + if not min_ttl <= max_ttl: + raise TTLArgumentException(f'Min TTL {min_ttl} is not lower than max TTL {max_ttl}') self.min_ttl = min_ttl self.max_ttl = max_ttl self.log.info(