From dabb9c928506376cdb3efb3b46e8f64c474b4773 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 13 May 2016 03:58:34 +0200 Subject: [PATCH] [mod] put import at the top of the file --- src/yunohost/domain.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index 61e3ff619..9cd94f56c 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -33,6 +33,10 @@ import requests from moulinette.core import MoulinetteError +from yunohost.service import service_regenconf +from yunohost.hook import hook_callback +from yunohost.dyndns import dyndns_subscribe + def domain_list(auth, raw=False, filter=None, limit=None, offset=None): """ @@ -77,8 +81,6 @@ def domain_add(auth, domain, dyndns=False): dyndns -- Subscribe to DynDNS """ - from yunohost.service import service_regenconf - from yunohost.hook import hook_callback attr_dict = { 'objectClass' : ['mailDomain', 'top'] } @@ -89,7 +91,6 @@ def domain_add(auth, domain, dyndns=False): if dyndns: if len(domain.split('.')) < 3: raise MoulinetteError(errno.EINVAL, m18n.n('domain_dyndns_invalid')) - from yunohost.dyndns import dyndns_subscribe try: r = requests.get('https://dyndns.yunohost.org/domains') @@ -178,9 +179,6 @@ def domain_remove(auth, domain, force=False): force -- Force the domain removal """ - from yunohost.service import service_regenconf - from yunohost.hook import hook_callback - if not force and domain not in domain_list(auth)['domains']: raise MoulinetteError(errno.EINVAL, m18n.n('domain_unknown'))