mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
autodns: fix/simplify registrar settings fetching
This commit is contained in:
parent
d4d576c492
commit
93b99635b7
1 changed files with 4 additions and 7 deletions
|
@ -536,20 +536,17 @@ def domain_dns_push(operation_logger, domain, dry_run=False, force=False, purge=
|
|||
|
||||
_assert_domain_exists(domain)
|
||||
|
||||
settings = domain_config_get(domain, key='dns.registrar')
|
||||
settings = domain_config_get(domain, key='dns.registrar', export=True)
|
||||
|
||||
registrar = settings["dns.registrar.registrar"].get("value")
|
||||
registrar = settings.get("registrar")
|
||||
|
||||
if not registrar or registrar in ["None", "yunohost"]:
|
||||
raise YunohostValidationError("domain_dns_push_not_applicable", domain=domain)
|
||||
|
||||
base_dns_zone = _get_dns_zone_for_domain(domain)
|
||||
|
||||
registrar_credentials = {
|
||||
k.split('.')[-1]: v["value"]
|
||||
for k, v in settings.items()
|
||||
if k != "dns.registrar.registar"
|
||||
}
|
||||
registrar_credentials = settings
|
||||
registrar_credentials.pop("registrar")
|
||||
|
||||
if not all(registrar_credentials.values()):
|
||||
raise YunohostValidationError("domain_registrar_is_not_configured", domain=domain)
|
||||
|
|
Loading…
Add table
Reference in a new issue