2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

[fix] nginx -t check

This commit is contained in:
Anand Doshi 2016-07-07 20:24:37 +05:30
parent 91de45adf4
commit c9cdb2c2ee
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ def check_uid():
sys.exit(1)
def cmd_requires_root():
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts'):
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts', 'reload-nginx'):
return True
if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'):
return True

View File

@ -1,7 +1,7 @@
from bench.utils import get_program, exec_cmd, get_cmd_output, fix_prod_setup_perms, get_bench_name, find_executable
from bench.config.supervisor import generate_supervisor_config
from bench.config.nginx import make_nginx_conf
import os
import os, subprocess
def setup_production(user, bench_path='.'):
generate_supervisor_config(bench_path=bench_path, user=user)
@ -99,5 +99,5 @@ def update_supervisor():
exec_cmd('sudo supervisorctl update')
def reload_nginx():
exec_cmd(['sudo', find_executable('nginx'), '-t'])
subprocess.check_output(['sudo', find_executable('nginx'), '-t'])
service('nginx', 'reload')