2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

perf: Remove bench.config.nginx from the import tree

This commit is contained in:
Aditya Hase 2021-02-21 10:05:40 +05:30
parent 5525548ced
commit 36e48c7dd7
No known key found for this signature in database
GPG Key ID: 0A55F0FCA0234972
2 changed files with 4 additions and 2 deletions

View File

@ -7,7 +7,6 @@ import click
# imports - module imports
import bench.config.lets_encrypt
import bench.config.nginx
import bench.config.procfile
import bench.config.production_setup
import bench.config.redis
@ -31,6 +30,8 @@ def setup_sudoers(user):
@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)
def setup_nginx(yes=False):
import bench.config.nginx
bench.config.nginx.make_nginx_conf(bench_path=".", yes=yes)

View File

@ -4,7 +4,6 @@ import os
from collections import defaultdict
# imports - module imports
from bench.config.nginx import make_nginx_conf
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)
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):
raise Exception("No such site")
update_site_config(site, config, bench_path=bench_path)