The option -d is deprecated, -p is preferred

This commit is contained in:
theo@manjaro 2022-07-01 14:40:52 +02:00
parent 882c024bc8
commit 02a4a5fecf
3 changed files with 3 additions and 5 deletions

View file

@ -338,7 +338,6 @@
"domain_dns_registrar_yunohost": "This domain is a nohost.me / nohost.st / ynh.fr and its DNS configuration is therefore automatically handled by YunoHost without any further configuration. (see the 'yunohost dyndns update' command)", "domain_dns_registrar_yunohost": "This domain is a nohost.me / nohost.st / ynh.fr and its DNS configuration is therefore automatically handled by YunoHost without any further configuration. (see the 'yunohost dyndns update' command)",
"domain_dyndns_already_subscribed": "You have already subscribed to a DynDNS domain", "domain_dyndns_already_subscribed": "You have already subscribed to a DynDNS domain",
"domain_dyndns_root_unknown": "Unknown DynDNS root domain", "domain_dyndns_root_unknown": "Unknown DynDNS root domain",
"domain_password_no_dyndns": "The password is only used for subscribing to (and maybe later unsubscribing from) the DynDNS service",
"domain_exists": "The domain already exists", "domain_exists": "The domain already exists",
"domain_hostname_failed": "Unable to set new hostname. This might cause an issue later (it might be fine).", "domain_hostname_failed": "Unable to set new hostname. This might cause an issue later (it might be fine).",
"domain_registrar_is_not_configured": "The registrar is not yet configured for domain {domain}.", "domain_registrar_is_not_configured": "The registrar is not yet configured for domain {domain}.",

View file

@ -455,11 +455,11 @@ domain:
pattern: *pattern_domain pattern: *pattern_domain
-d: -d:
full: --dyndns full: --dyndns
help: Subscribe to the DynDNS service help: (Deprecated, using the -p option in order to set a password is recommended) Subscribe to the DynDNS service
action: store_true action: store_true
-p: -p:
full: --password full: --password
help: Password used to later delete the domain ( if subscribing to the DynDNS service ) help: Subscribe to the DynDNS service with a password, used to later delete the domain
extra: extra:
pattern: *pattern_password pattern: *pattern_password
comment: dyndns_added_password comment: dyndns_added_password

View file

@ -163,6 +163,7 @@ def domain_add(operation_logger, domain, dyndns=False,password=None):
domain = domain.encode("idna").decode("utf-8") domain = domain.encode("idna").decode("utf-8")
# DynDNS domain # DynDNS domain
dyndns = dyndns or (password!=None) # If a password is specified, then it is obviously a dyndns domain, no need for the extra option
if dyndns: if dyndns:
from yunohost.utils.dns import is_yunohost_dyndns_domain from yunohost.utils.dns import is_yunohost_dyndns_domain
@ -184,8 +185,6 @@ def domain_add(operation_logger, domain, dyndns=False,password=None):
# Actually subscribe # Actually subscribe
dyndns_subscribe(domain=domain,password=password) dyndns_subscribe(domain=domain,password=password)
elif password: # If a password is provided, while not subscribing to a DynDNS service
logger.warning(m18n.n("domain_password_no_dyndns"))
_certificate_install_selfsigned([domain], True) _certificate_install_selfsigned([domain], True)