mirror of
https://codeberg.org/privacy1st/netcup-dns
synced 2024-12-22 23:36:04 +01:00
feat: inform about skipped cfg files
This commit is contained in:
parent
f231334e1b
commit
9ab7e48159
@ -24,12 +24,12 @@ def main():
|
|||||||
cfg_dir: Path = args.cfg_dir
|
cfg_dir: Path = args.cfg_dir
|
||||||
cache: RecordDestinationCache | None = args.cache
|
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:
|
for cfg_file in cfg_files:
|
||||||
cfg: dict = json.loads(cfg_file.read_text())
|
cfg: dict = json.loads(cfg_file.read_text())
|
||||||
|
|
||||||
if len(cfg) == 0 or ('disabled' in cfg and cfg['disabled'] is True):
|
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
|
continue
|
||||||
|
|
||||||
customer = cfg['customer']
|
customer = cfg['customer']
|
||||||
|
Loading…
Reference in New Issue
Block a user