Add hook support in domain_dns_conf

This commit is contained in:
Josué Tille 2018-08-26 12:47:15 +02:00
parent dfd1a8b1a6
commit 439a999c02

View file

@ -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"))