bind: create zones directory on setup action

Closes: #1571

Signed-off-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Nektarios Katakis 2020-02-12 20:19:45 +00:00 committed by James Valleroy
parent d0fcc179a7
commit 3f0642109c
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -20,9 +20,10 @@ Configuration helper for BIND server.
"""
import argparse
from pathlib import Path
from plinth import action_utils
from plinth.modules.bind import CONFIG_FILE, DEFAULT_CONFIG
from plinth.modules.bind import CONFIG_FILE, DEFAULT_CONFIG, ZONES_DIR
from plinth.modules.bind import set_forwarders, set_dnssec
@ -47,6 +48,9 @@ def subcommand_setup(_):
conf_file = open(CONFIG_FILE, "w")
conf_file.write(DEFAULT_CONFIG)
conf_file.close()
Path(ZONES_DIR).mkdir(exist_ok=True, parents=True)
action_utils.service_restart('bind9')