mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1424 from YunoHost/ci-format-dev
[CI] Format code with Black
This commit is contained in:
commit
97e17bbddb
4 changed files with 11 additions and 17 deletions
|
@ -680,7 +680,7 @@ def app_manifest(app):
|
|||
shutil.rmtree(extracted_app_folder)
|
||||
|
||||
raw_questions = manifest.get("arguments", {}).get("install", [])
|
||||
manifest['arguments']['install'] = hydrate_questions_with_choices(raw_questions)
|
||||
manifest["arguments"]["install"] = hydrate_questions_with_choices(raw_questions)
|
||||
|
||||
return manifest
|
||||
|
||||
|
|
|
@ -111,9 +111,7 @@ def certificate_status(domains, full=False):
|
|||
return {"certificates": certificates}
|
||||
|
||||
|
||||
def certificate_install(
|
||||
domain_list, force=False, no_checks=False, self_signed=False
|
||||
):
|
||||
def certificate_install(domain_list, force=False, no_checks=False, self_signed=False):
|
||||
"""
|
||||
Install a Let's Encrypt certificate for given domains (all by default)
|
||||
|
||||
|
@ -231,9 +229,7 @@ def _certificate_install_selfsigned(domain_list, force=False):
|
|||
operation_logger.error(msg)
|
||||
|
||||
|
||||
def _certificate_install_letsencrypt(
|
||||
domains, force=False, no_checks=False
|
||||
):
|
||||
def _certificate_install_letsencrypt(domains, force=False, no_checks=False):
|
||||
from yunohost.domain import domain_list, _assert_domain_exists
|
||||
|
||||
if not os.path.exists(ACCOUNT_KEY_FILE):
|
||||
|
@ -297,9 +293,7 @@ def _certificate_install_letsencrypt(
|
|||
operation_logger.success()
|
||||
|
||||
|
||||
def certificate_renew(
|
||||
domains, force=False, no_checks=False, email=False
|
||||
):
|
||||
def certificate_renew(domains, force=False, no_checks=False, email=False):
|
||||
"""
|
||||
Renew Let's Encrypt certificate for given domains (all by default)
|
||||
|
||||
|
|
|
@ -492,6 +492,7 @@ class DomainConfigPanel(ConfigPanel):
|
|||
filter_key = self.filter_key.split(".") if self.filter_key != "" else []
|
||||
if not filter_key or filter_key[0] == "dns":
|
||||
from yunohost.dns import _get_registrar_config_section
|
||||
|
||||
toml["dns"]["registrar"] = _get_registrar_config_section(self.entity)
|
||||
|
||||
# FIXME: Ugly hack to save the registar id/value and reinject it in _load_current_values ...
|
||||
|
@ -541,17 +542,13 @@ def domain_cert_status(domain_list, full=False):
|
|||
return certificate_status(domain_list, full)
|
||||
|
||||
|
||||
def domain_cert_install(
|
||||
domain_list, force=False, no_checks=False, self_signed=False
|
||||
):
|
||||
def domain_cert_install(domain_list, force=False, no_checks=False, self_signed=False):
|
||||
from yunohost.certificate import certificate_install
|
||||
|
||||
return certificate_install(domain_list, force, no_checks, self_signed)
|
||||
|
||||
|
||||
def domain_cert_renew(
|
||||
domain_list, force=False, no_checks=False, email=False
|
||||
):
|
||||
def domain_cert_renew(domain_list, force=False, no_checks=False, email=False):
|
||||
from yunohost.certificate import certificate_renew
|
||||
|
||||
return certificate_renew(domain_list, force, no_checks, email)
|
||||
|
|
|
@ -1397,11 +1397,14 @@ def ask_questions_and_parse_answers(
|
|||
|
||||
return out
|
||||
|
||||
|
||||
def hydrate_questions_with_choices(raw_questions: List) -> List:
|
||||
out = []
|
||||
|
||||
for raw_question in raw_questions:
|
||||
question = ARGUMENTS_TYPE_PARSERS[raw_question.get("type", "string")](raw_question)
|
||||
question = ARGUMENTS_TYPE_PARSERS[raw_question.get("type", "string")](
|
||||
raw_question
|
||||
)
|
||||
if question.choices:
|
||||
raw_question["choices"] = question.choices
|
||||
raw_question["default"] = question.default
|
||||
|
|
Loading…
Add table
Reference in a new issue