Skip to content
Snippets Groups Projects
Commit 069a3048 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed script to set domain (refs #21163).

parent c9e522bf
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@ class SetAppDomain():
domain: The new domain.''' % __file__
UNIX_USER_PATTERN = r'[a-z0-9\-]+'
DOMAIN_PATTERN = r'[a-z0-9\-]+\.[a-z0-9\-]+\.[a-z]+'
NGINX_SERVER_NAME_PATTERN = r'\s*server_name\s+([\w\-\_\.\ ]+);'
def __init__(self, *args):
args = list(args)
......@@ -100,8 +99,8 @@ class SetAppDomain():
new_vhost = ''
changed_lines = 0
for line in vhost.split('\n'):
if re.match(self.NGINX_SERVER_NAME_PATTERN, line):
new_vhost += re.sub(self.NGINX_SERVER_NAME_PATTERN, line, new_domain) + '\n'
if re.match(r'\s*server_name\s+([\w\-\_\.\ ]+);', line):
new_vhost += re.sub(r'server_name\s+([\w\-\_\.\ ]+);', line, 'server_name %s;' % new_domain) + '\n'
changed_lines += 1
else:
new_vhost += line + '\n'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment