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 action_help: List supported registrars API
api: GET /domains/registrars/catalog api: GET /domains/registrars/catalog
arguments: arguments:
-r:
full: --registrar-name
help: Display given registrar info to create form
-f: -f:
full: --full full: --full
help: Display all details, including info to create forms help: Display all details, including info to create forms

View file

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