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
+1 -1
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