Add registrar name option to registrar catalog

This commit is contained in:
MercierCorentin 2021-07-13 17:01:51 +02:00
parent 31c31b1298
commit d7c88cbf78
2 changed files with 18 additions and 8 deletions

View file

@ -620,6 +620,9 @@ domain:
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

View file

@ -917,15 +917,22 @@ def domain_registrar_info(domain):
for option_key, option_value in registrar_info['options'].items():
logger.info("Option " + option_key + ": " + option_value)
def domain_registrar_catalog(full):
registrars = yaml.load(open(REGISTRAR_LIST_PATH, "r+"))
for registrar in registrars:
logger.info("Registrar : " + registrar)
if full :
logger.info("Options : ")
for option in registrars[registrar]:
logger.info("\t- " + option)
def _print_registrar_info(registrar_name, full, options):
logger.info("Registrar : " + registrar_name)
if full :
logger.info("Options : ")
for option in options:
logger.info("\t- " + option)
def domain_registrar_catalog(registrar_name, full):
registrars = yaml.load(open(REGISTRAR_LIST_PATH, "r+"))
if registrar_name and registrar_name in registrars.keys() :
_print_registrar_info(registrar_name, True, registrars[registrar_name])
else:
for registrar in registrars:
_print_registrar_info(registrar, full, registrars[registrar])
def domain_registrar_set(domain, registrar, args):