2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 23:55:57 +00:00

[Fix] Fixed disable_production command

This commit is contained in:
shreyas 2016-06-29 16:45:26 +05:30
parent fd739aa199
commit 41f3f7e639
3 changed files with 4 additions and 8 deletions

View File

@ -93,6 +93,7 @@ def setup_config():
from bench.config.common_site_config import make_config
make_config('.')
setup.add_command(setup_sudoers)
setup.add_command(setup_nginx)
setup.add_command(setup_supervisor)

View File

@ -135,5 +135,3 @@ def disable_production():
"""Disables production environment for the bench."""
from bench.config.production_setup import disable_production
disable_production(bench_path='.')
click.echo("Please run 'bench setup procfile'")
click.echo("Run 'bench start' to start development environment")

View File

@ -40,19 +40,16 @@ def disable_production(bench_path='.'):
if os.path.islink(supervisor_conf):
os.unlink(supervisor_conf)
exec_cmd('supervisorctl reread')
exec_cmd('supervisorctl reload')
exec_cmd('sudo supervisorctl reread')
exec_cmd('sudo supervisorctl update')
# nginx
nginx_conf = '/etc/nginx/conf.d/{bench_name}.conf'.format(bench_name=bench_name)
if os.path.islink(nginx_conf):
os.unlink(nginx_conf)
service('nginx', 'reload')
if os.environ.get('NO_SERVICE_RESTART'):
return
service('nginx', 'restart')
def service(service, option):
if os.path.basename(get_program(['systemctl']) or '') == 'systemctl' and is_running_systemd():