1
0
Fork 0
mirror of https://github.com/Luzifer/dns.git synced 2024-11-14 00:42:48 +00:00

Remove tmp.zone files if they are not moved in place

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-02-06 20:06:34 +01:00
parent fd0bec2c55
commit bbae3c1e22
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -122,6 +122,8 @@ def write_zone(zone, ttl, soa, nameserver, mailserver, entries):
print("Generated and replaced zone file for {}".format(zone))
diff_files("zones/db.{}".format(zone), "zones/tmp.{}".format(zone))
os.rename("zones/tmp.{}".format(zone), "zones/db.{}".format(zone))
else:
os.unlink("zones/tmp.{}".format(zone))
def main():