From 7cbd5641bd3ed15af7fb3c4d0f035e66e86b155a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 22 Jun 2018 06:03:07 +0200 Subject: [PATCH] [fix] fix recursive super slow import in certificate.py --- src/yunohost/certificate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index 6d70b9b0a..bcd046644 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -40,7 +40,6 @@ from yunohost.vendor.acme_tiny.acme_tiny import get_crt as sign_certificate from moulinette.core import MoulinetteError from moulinette.utils.log import getActionLogger -import yunohost.domain from yunohost.utils.network import get_public_ip from moulinette import m18n @@ -96,6 +95,8 @@ def certificate_status(auth, domain_list, full=False): full -- Display more info about the certificates """ + import yunohost.domain + # Check if old letsencrypt_ynh is installed # TODO / FIXME - Remove this in the future once the letsencrypt app is # not used anymore @@ -243,6 +244,8 @@ def _certificate_install_selfsigned(domain_list, force=False): def _certificate_install_letsencrypt(auth, domain_list, force=False, no_checks=False, staging=False): + import yunohost.domain + if not os.path.exists(ACCOUNT_KEY_FILE): _generate_account_key() @@ -309,6 +312,8 @@ def certificate_renew(auth, domain_list, force=False, no_checks=False, email=Fal email -- Emails root if some renewing failed """ + import yunohost.domain + # Check if old letsencrypt_ynh is installed # TODO / FIXME - Remove this in the future once the letsencrypt app is # not used anymore @@ -402,6 +407,8 @@ def certificate_renew(auth, domain_list, force=False, no_checks=False, email=Fal ############################################################################### def _check_old_letsencrypt_app(): + import yunohost.domain + installedAppIds = [app["id"] for app in yunohost.app.app_list(installed=True)["apps"]] if "letsencrypt" not in installedAppIds: