Improve check that a dyndns domain already exists

This commit is contained in:
Alexandre Aubin 2021-01-22 03:04:56 +01:00
parent cc6cc1860a
commit 071732dd7f

View file

@ -119,11 +119,11 @@ def domain_add(operation_logger, domain, dyndns=False):
# DynDNS domain
if dyndns:
# Do not allow to subscribe to multiple dyndns domains...
if os.path.exists("/etc/cron.d/yunohost-dyndns"):
raise YunohostError("domain_dyndns_already_subscribed")
from yunohost.dyndns import dyndns_subscribe, _dyndns_provides, _guess_current_dyndns_domain
from yunohost.dyndns import dyndns_subscribe, _dyndns_provides
# Do not allow to subscribe to multiple dyndns domains...
if _guess_current_dyndns_domain("dyndns.yunohost.org") != (None, None):
raise YunohostError('domain_dyndns_already_subscribed')
# Check that this domain can effectively be provided by
# dyndns.yunohost.org. (i.e. is it a nohost.me / noho.st)