Merge rebuild_nginx into update_host
This commit is contained in:
parent
d6f738c47e
commit
ebd24befaf
@ -55,14 +55,10 @@ class VMMgr:
|
||||
self.reload_nginx()
|
||||
|
||||
def update_host(self, domain, port):
|
||||
# Update domain and port and rebuild all configuration. Web interface calls restart_nginx() in WSGI close handler
|
||||
# Update domain and port, rebuild all configuration and restart nginx
|
||||
self.domain = self.conf['host']['domain'] = domain
|
||||
self.port = self.conf['host']['port'] = port
|
||||
self.conf.save()
|
||||
# Rebuild and restart nginx if it was requested.
|
||||
self.rebuild_nginx()
|
||||
|
||||
def rebuild_nginx(self):
|
||||
# Rebuild nginx config for the portal app. Web interface calls restart_nginx() in WSGI close handler
|
||||
with open(os.path.join(NGINX_DIR, 'default.conf'), 'w') as f:
|
||||
f.write(templates.NGINX_DEFAULT.format(port=self.port, domain_esc=self.domain.replace('.', '\\.')))
|
||||
|
Loading…
Reference in New Issue
Block a user