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

Use MS script to change domain name (refs #22092).

parent 4f477ddf
No related branches found
No related tags found
No related merge requests found
...@@ -196,17 +196,11 @@ class SetAppDomain(): ...@@ -196,17 +196,11 @@ class SetAppDomain():
'python3 %s %s site_url="%s"' % (os.path.join(ms_path, 'scripts', 'mssiteconfig.py'), instance, new_url), 'python3 %s %s site_url="%s"' % (os.path.join(ms_path, 'scripts', 'mssiteconfig.py'), instance, new_url),
# reset all local resources managers # reset all local resources managers
'python3 %s %s local' % (os.path.join(ms_path, 'scripts', 'reset_service_resources.py'), instance), 'python3 %s %s local' % (os.path.join(ms_path, 'scripts', 'reset_service_resources.py'), instance),
# change configuration of celerity on MS side # change configuration of celerity in MS and in workers
'sed -i "s@\'url\': \'\\(http[s]*\\)://.*\',@\'url\': \'\\1://%s\',@" /etc/celerity/config.py' % new_domain, 'python3 %s update %s' % (os.path.join(ms_path, 'scripts', 'celerity_config_updater.py'), instance),
'sed -i "s@SERVER_URL.*@SERVER_URL = \'%s:6200\'@" /etc/celerity/config.py' % new_url,
# restart ms # restart ms
'mscontroller.py restart -u %s' % instance, 'mscontroller.py restart -u %s' % instance,
] ]
worker_ips = utils.get_conf('CELERITY_WORKER_IP') or '127.0.1.1'
# change configuration of celerity on worker side
for worker_ip in worker_ips.split(','):
cmds.append('rsync -avz /etc/celerity/config.py root@%s:/etc/celerity/config.py' % worker_ip)
cmds.append('ssh root@%s service celerity-workers restart' % worker_ip)
utils.run_commands(cmds) utils.run_commands(cmds)
except Exception as e: except Exception as e:
log('Unable to set domain in MS database and Celerity config:\n%s' % e) log('Unable to set domain in MS database and Celerity config:\n%s' % e)
......
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