1
0
mirror of https://github.com/oskar456/dzonegit.git synced 2024-05-11 05:55:41 +00:00

Sorted zone files for config templating

This commit is contained in:
Ondřej Caletka
2018-07-16 15:49:36 +02:00
parent dfae21f1ff
commit 74b256168d

View File

@ -298,7 +298,7 @@ def template_config(checkoutpath, template):
zones = set()
mapping = {"datetime": datetime.datetime.now().strftime("%c")}
out.append(headertpl.substitute(mapping))
for f in Path(checkoutpath).glob("**/*.zone"):
for f in sorted(Path(checkoutpath).glob("**/*.zone")):
zonename = get_zone_name(f, f.read_bytes())
if zonename in zones:
continue # Safety net in case duplicate zone file is found