2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

Merge pull request #199 from shreyasp/eval-conf-symlink

[Fix] Create symlinks for supervisor and nginx only if they do not exist
This commit is contained in:
Anand Doshi 2016-04-21 18:48:18 +05:30
commit 6060915ca6

View File

@ -16,8 +16,11 @@ def setup_production(user, bench='.'):
supervisor_conf = os.path.join(get_supervisor_confdir(), '{bench_name}.{extn}'.format( supervisor_conf = os.path.join(get_supervisor_confdir(), '{bench_name}.{extn}'.format(
bench_name=bench_name, extn=supervisor_conf_extn)) bench_name=bench_name, extn=supervisor_conf_extn))
# Check if symlink exists, If not then create it.
if not os.path.islink(supervisor_conf):
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), supervisor_conf) os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), supervisor_conf)
if not os.path.islink(nginx_conf):
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), nginx_conf) os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), nginx_conf)
exec_cmd('supervisorctl reload') exec_cmd('supervisorctl reload')