From 36e48c7dd7625edb4dded617992576faa01c96e6 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Sun, 21 Feb 2021 10:05:40 +0530 Subject: [PATCH] perf: Remove bench.config.nginx from the import tree --- bench/commands/setup.py | 3 ++- bench/config/site_config.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bench/commands/setup.py b/bench/commands/setup.py index 08e2d4f2..87b0d5b7 100755 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -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) diff --git a/bench/config/site_config.py b/bench/config/site_config.py index 696185c8..9ea67a86 100644 --- a/bench/config/site_config.py +++ b/bench/config/site_config.py @@ -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)