From 9ab7e481594c4eb70278dbdd02aade18d4cd0cd9 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 9 Dec 2024 11:06:18 +0100 Subject: [PATCH] feat: inform about skipped cfg files --- src/netcup_dns/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netcup_dns/main.py b/src/netcup_dns/main.py index b67fbb0..2b55b8d 100644 --- a/src/netcup_dns/main.py +++ b/src/netcup_dns/main.py @@ -24,12 +24,12 @@ def main(): cfg_dir: Path = args.cfg_dir cache: RecordDestinationCache | None = args.cache - cfg_files = [file for file in cfg_dir.iterdir() if file.name.endswith('.json') and file.is_file()] + cfg_files: list[Path] = [file for file in cfg_dir.iterdir() if file.name.endswith('.json') and file.is_file()] for cfg_file in cfg_files: cfg: dict = json.loads(cfg_file.read_text()) if len(cfg) == 0 or ('disabled' in cfg and cfg['disabled'] is True): - # Skip empty or disabled configuration file. + print(f'Skipped empty or disabled config file {cfg_file.absolute()}') continue customer = cfg['customer']