diff options
Diffstat (limited to 'python/knot_resolver/manager/files/reload.py')
-rw-r--r-- | python/knot_resolver/manager/files/reload.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/knot_resolver/manager/files/reload.py b/python/knot_resolver/manager/files/reload.py new file mode 100644 index 00000000..6dfd5874 --- /dev/null +++ b/python/knot_resolver/manager/files/reload.py @@ -0,0 +1,17 @@ +import logging + +from knot_resolver.controller.registered_workers import command_registered_workers +from knot_resolver.datamodel import KresConfig + +logger = logging.getLogger(__name__) + + +async def files_reload(config: KresConfig) -> None: + cert_file = config.network.tls.cert_file + key_file = config.network.tls.key_file + + if cert_file and key_file: + logger.info("TLS cert files reload triggered") + + cmd = f"net.tls('{cert_file}', '{key_file}')" + await command_registered_workers(cmd) |