Skip to content

Commit

Permalink
perf: Remove bench.config.nginx from the import tree
Browse files Browse the repository at this point in the history
  • Loading branch information
adityahase committed Feb 21, 2021
1 parent 5525548 commit 36e48c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bench/commands/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

# 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
Expand All @@ -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)


Expand Down
3 changes: 2 additions & 1 deletion bench/config/site_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from collections import defaultdict

# imports - module imports
from bench.config.nginx import make_nginx_conf
from bench.utils import get_sites


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 36e48c7

Please sign in to comment.