registrars: remove unimplemented or unecessary stuff

This commit is contained in:
Alexandre Aubin 2021-09-01 16:36:38 +02:00
parent 1c2fff750d
commit 01bc6762aa
3 changed files with 17 additions and 37 deletions

View file

@ -572,6 +572,12 @@ domain:
registrar:
subcategory_help: Manage domains registrars
actions:
### domain_registrar_catalog()
catalog:
action_help: List supported registrars API
api: GET /domains/registrars/catalog
### domain_registrar_set()
set:
action_help: Set domain registrar
@ -597,24 +603,6 @@ domain:
extra:
pattern: *pattern_domain
### domain_registrar_list()
list:
action_help: List registrars configured by DNS zone
api: GET /domains/registrars
### domain_registrar_catalog()
catalog:
action_help: List supported registrars API
api: GET /domains/registrars/catalog
arguments:
-r:
full: --registrar-name
help: Display given registrar info to create form
-f:
full: --full
help: Display all details, including info to create forms
action: store_true
### domain_registrar_push()
push:
action_help: Push DNS records to registrar

View file

@ -419,16 +419,8 @@ def domain_registrar_info(domain):
return registrar_info
def domain_registrar_catalog(registrar_name, full):
registrars = read_yaml(REGISTRAR_LIST_PATH)
if registrar_name:
if registrar_name not in registrars.keys():
raise YunohostValidationError("domain_registrar_unknown", registrar=registrar_name)
else:
return registrars[registrar_name]
else:
return registrars
def domain_registrar_catalog():
return read_yaml(REGISTRAR_LIST_PATH)
def domain_registrar_set(domain, registrar, args):
@ -539,8 +531,8 @@ def domain_registrar_push(operation_logger, domain):
# Finally, push the new record or update the existing one
record_to_push = {
"action": "update" if already_exists else "create"
"type": record["type"]
"action": "update" if already_exists else "create",
"type": record["type"],
"name": record["name"],
"content": record["value"],
# FIXME Removed TTL, because it doesn't work with Gandi.

View file

@ -536,14 +536,9 @@ def domain_dns_conf(domain):
return yunohost.dns.domain_dns_conf(domain)
def domain_registrar_info(domain):
def domain_registrar_catalog():
import yunohost.dns
return yunohost.dns.domain_registrar_info(domain)
def domain_registrar_catalog(registrar_name, full):
import yunohost.dns
return yunohost.dns.domain_registrar_catalog(registrar_name, full)
return yunohost.dns.domain_registrar_catalog()
def domain_registrar_set(domain, registrar, args):
@ -551,6 +546,11 @@ def domain_registrar_set(domain, registrar, args):
return yunohost.dns.domain_registrar_set(domain, registrar, args)
def domain_registrar_info(domain):
import yunohost.dns
return yunohost.dns.domain_registrar_info(domain)
def domain_registrar_push(domain):
import yunohost.dns
return yunohost.dns.domain_registrar_push(domain)