mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
perf: Remove bench.config.nginx from the import tree
This commit is contained in:
parent
5525548ced
commit
36e48c7dd7
@ -7,7 +7,6 @@ import click
|
|||||||
|
|
||||||
# imports - module imports
|
# imports - module imports
|
||||||
import bench.config.lets_encrypt
|
import bench.config.lets_encrypt
|
||||||
import bench.config.nginx
|
|
||||||
import bench.config.procfile
|
import bench.config.procfile
|
||||||
import bench.config.production_setup
|
import bench.config.production_setup
|
||||||
import bench.config.redis
|
import bench.config.redis
|
||||||
@ -31,6 +30,8 @@ def setup_sudoers(user):
|
|||||||
@click.command("nginx", help="Generate configuration files for NGINX")
|
@click.command("nginx", help="Generate configuration files for NGINX")
|
||||||
@click.option("--yes", help="Yes to regeneration of nginx config file", default=False, is_flag=True)
|
@click.option("--yes", help="Yes to regeneration of nginx config file", default=False, is_flag=True)
|
||||||
def setup_nginx(yes=False):
|
def setup_nginx(yes=False):
|
||||||
|
import bench.config.nginx
|
||||||
|
|
||||||
bench.config.nginx.make_nginx_conf(bench_path=".", yes=yes)
|
bench.config.nginx.make_nginx_conf(bench_path=".", yes=yes)
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import os
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
# imports - module imports
|
# imports - module imports
|
||||||
from bench.config.nginx import make_nginx_conf
|
|
||||||
from bench.utils import get_sites
|
from bench.utils import get_sites
|
||||||
|
|
||||||
|
|
||||||
@ -35,6 +34,8 @@ def set_ssl_certificate_key(site, ssl_certificate_key, bench_path='.', gen_confi
|
|||||||
set_site_config_nginx_property(site, {"ssl_certificate_key": ssl_certificate_key}, bench_path=bench_path, gen_config=gen_config)
|
set_site_config_nginx_property(site, {"ssl_certificate_key": ssl_certificate_key}, bench_path=bench_path, gen_config=gen_config)
|
||||||
|
|
||||||
def set_site_config_nginx_property(site, config, bench_path='.', gen_config=True):
|
def set_site_config_nginx_property(site, config, bench_path='.', gen_config=True):
|
||||||
|
from bench.config.nginx import make_nginx_conf
|
||||||
|
|
||||||
if site not in get_sites(bench_path=bench_path):
|
if site not in get_sites(bench_path=bench_path):
|
||||||
raise Exception("No such site")
|
raise Exception("No such site")
|
||||||
update_site_config(site, config, bench_path=bench_path)
|
update_site_config(site, config, bench_path=bench_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user