From 439a999c02c172fe1d0299bc3a7f779d719e8a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 26 Aug 2018 12:47:15 +0200 Subject: [PATCH] Add hook support in domain_dns_conf --- src/yunohost/domain.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 560a6fda5..644b233d2 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -188,6 +188,7 @@ def domain_dns_conf(domain, ttl=None): ttl -- Time to live """ + from yunohost.hook import hook_callback ttl = 3600 if ttl is None else ttl @@ -209,6 +210,11 @@ def domain_dns_conf(domain, ttl=None): for record in dns_conf["mail"]: result += "\n{name} {ttl} IN {type} {value}".format(**record) + result += "\n\n" + result += "; Custom\n" + + result += ''.join(hook_callback('custom_dns_rules', args=[])['stdreturn']) + is_cli = True if msettings.get('interface') == 'cli' else False if is_cli: logger.info(m18n.n("domain_dns_conf_is_just_a_recommendation"))