From bbae3c1e22a5c6ac4e21522c25cdb1aa9a45f2b8 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 6 Feb 2018 20:06:34 +0100 Subject: [PATCH] Remove tmp.zone files if they are not moved in place Signed-off-by: Knut Ahlers --- generateZonefiles.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generateZonefiles.py b/generateZonefiles.py index b72ad4d..d0607f5 100644 --- a/generateZonefiles.py +++ b/generateZonefiles.py @@ -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():