From 14c3fb84ff8058cdf87ca4d090c20b7a8833b8fc Mon Sep 17 00:00:00 2001 From: Kload Date: Mon, 8 Jul 2013 14:38:26 +0200 Subject: [PATCH] bugfix --- yunohost_tools.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yunohost_tools.py b/yunohost_tools.py index b8f18056..c921c761 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -230,16 +230,6 @@ def tools_postinstall(domain, password, dyndns=False): password -- YunoHost admin password """ - if len(domain.split('.')) >= 3: - r = requests.get('http://dyndns.yunohost.org/domains') - dyndomains = json.loads(r.text) - dyndomain = '.'.join(new_domain.split('.')[1:]) - if dyndomain in dyndomains: - if requests.get('http://dyndns.yunohost.org/test/'+ domain).status_code == 200: - dyndns=True - else: - raise YunoHostError(17, _("Domain is already taken")) - with YunoHostLDAP(password='yunohost') as yldap: try: with open('/etc/yunohost/installed') as f: pass @@ -248,6 +238,16 @@ def tools_postinstall(domain, password, dyndns=False): else: raise YunoHostError(17, _("YunoHost is already installed")) + if len(domain.split('.')) >= 3: + r = requests.get('http://dyndns.yunohost.org/domains') + dyndomains = json.loads(r.text) + dyndomain = '.'.join(domain.split('.')[1:]) + if dyndomain in dyndomains: + if requests.get('http://dyndns.yunohost.org/test/'+ domain).status_code == 200: + dyndns=True + else: + raise YunoHostError(17, _("Domain is already taken")) + # Create required folders folders_to_create = [ '/etc/yunohost/apps',