From 1f7d56940e537aaf64f1f47a80da4c9ff7119031 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 13 Aug 2017 14:00:15 -0400 Subject: [PATCH] [fix] Tell user that domain dns-conf shows a recommendation only --- locales/en.json | 1 + src/yunohost/domain.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/locales/en.json b/locales/en.json index 3d70ab2b3..035b93f95 100644 --- a/locales/en.json +++ b/locales/en.json @@ -141,6 +141,7 @@ "domain_creation_failed": "Unable to create domain", "domain_deleted": "The domain has been deleted", "domain_deletion_failed": "Unable to delete domain", + "domain_dns_conf_is_just_a_recommendation": "This command shows you what is the *recommended* configuration. It does not actually set up the DNS configuration for you. It is your responsability to configure your DNS zone in your registrar according to this recommendation.", "domain_dyndns_already_subscribed": "You've already subscribed to a DynDNS domain", "domain_dyndns_invalid": "Invalid domain to use with DynDNS", "domain_dyndns_root_unknown": "Unknown DynDNS root domain", diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 3223183bb..589345196 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -33,7 +33,7 @@ import requests from urllib import urlopen -from moulinette import m18n +from moulinette import m18n, msettings from moulinette.core import MoulinetteError from moulinette.utils.log import getActionLogger @@ -220,6 +220,10 @@ def domain_dns_conf(domain, ttl=None): for record in dns_conf["mail"]: result += "\n{name} {ttl} IN {type} {value}".format(**record) + is_cli = True if msettings.get('interface') == 'cli' else False + if is_cli: + logger.warning(m18n.n("domain_dns_conf_is_just_a_recommendation")) + return result