diff --git a/yunohost_domain.py b/yunohost_domain.py index 1fd3164e..7b0dbafa 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -31,8 +31,6 @@ import shutil from urllib import urlopen from yunohost import YunoHostError, YunoHostLDAP, win_msg, colorize, validate, get_required_args -a2_template_path = '/etc/yunohost/apache/templates' -a2_app_conf_path = '/etc/yunohost/apache/domains' def domain_list(filter=None, limit=None, offset=None): """ @@ -66,13 +64,12 @@ def domain_list(filter=None, limit=None, offset=None): return { 'Domains': result_list } -def domain_add(domains, raw=False, main=False): +def domain_add(domains, main=False): """ Create a custom domain Keyword argument: domains -- Domain name to add - raw -- Do not configure Apache and LemonLDAP for the domain """ with YunoHostLDAP() as yldap: @@ -114,12 +111,7 @@ def domain_add(domains, raw=False, main=False): try: yldap.validate_uniqueness({ 'virtualdomain' : domain }) except YunoHostError: - if not raw: - win_msg(_("Web config created")) - result.append(domain) - break - else: - raise YunoHostError(17, _("Domain already created")) + raise YunoHostError(17, _("Domain already created")) attr_dict['virtualdomain'] = domain diff --git a/yunohost_tools.py b/yunohost_tools.py index 8f58fc23..7b384878 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -162,7 +162,7 @@ def tools_maindomain(old_domain, new_domain, dyndns=False): for line in lines: sources.write(re.sub(r''+ old_domain +'', new_domain, line)) - domain_add([new_domain], raw=False, main=True) + domain_add([new_domain], main=True) # TODO: Generate SSOwat conf