mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Return main domain if no domain is provide (closes #91)
This commit is contained in:
parent
3cafe1dda0
commit
365b84ee69
1 changed files with 4 additions and 1 deletions
|
@ -99,7 +99,7 @@ def tools_adminpw(old_password, new_password):
|
|||
raise YunoHostError(22, _("Invalid password"))
|
||||
|
||||
|
||||
def tools_maindomain(old_domain, new_domain, dyndns=False):
|
||||
def tools_maindomain(old_domain=None, new_domain=None, dyndns=False):
|
||||
"""
|
||||
Main domain change tool
|
||||
|
||||
|
@ -113,6 +113,9 @@ def tools_maindomain(old_domain, new_domain, dyndns=False):
|
|||
with open('/etc/yunohost/current_host', 'r') as f:
|
||||
old_domain = f.readline().rstrip()
|
||||
|
||||
if not new_domain:
|
||||
return { 'Current main domain': old_domain }
|
||||
|
||||
validate(r'^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$', old_domain)
|
||||
|
||||
config_files = [
|
||||
|
|
Loading…
Reference in a new issue