From 37f946305d97b5617fcd999036e0a958fb33023f Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 2 Aug 2021 18:13:50 +0200 Subject: [PATCH] Fixed wrong file-path --- daemon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index fb88bf8..ac1b5e2 100755 --- a/daemon.py +++ b/daemon.py @@ -193,14 +193,14 @@ ignoreLinesRexp = r"^\s*(var|D\(|DnsProvider\(|DefaultTTL\()" def adaptFileForRequire(zone, dumpFile): log.debug(f"{zone} |\tRewriting file '{dumpFile}'..") - with open(dumpFile, 'r') as fin: - with open(f"{dumpFile}.tmp", 'w+') as fout: + with open(f"{HOSTS_PATH}/{dumpFile}", 'r') as fin: + with open(f"{HOSTS_PATH}/{dumpFile}.tmp", 'w+') as fout: fout.write(f'D_EXTEND("{zone}",\n') for line in fin: if not re.match(ignoreLinesRexp, line): fout.write(line) - os.replace(f"{dumpFile}.tmp", dumpFile) + os.replace(f"{HOSTS_PATH}/{dumpFile}.tmp", dumpFile) def dnscontrolPush(zone): log.debug(f'{zone} |\tPushing..')