2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

fix: setup nginx fails for broken site_config

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
Ameya Shenoy 2018-11-30 13:47:06 +05:30
parent b9f750fc42
commit 8b02bed71c
No known key found for this signature in database
GPG Key ID: AC016A555657D0A3

View File

@ -187,7 +187,23 @@ def get_sites_with_config(bench_path):
ret = []
for site in sites:
try:
site_config = get_site_config(site, bench_path=bench_path)
except Exception as e:
strict_nginx = get_config(bench_path).get('strict_nginx')
if strict_nginx:
print("\n\nERROR: The site config for the site {} is broken.".format(site),
"If you want this command to pass, instead of just throwing an error,",
"You may remove the 'strict_nginx' flag from common_site_config.json or set it to 0",
"\n\n")
raise (e)
else:
print("\n\nWARNING: The site config for the site {} is broken.".format(site),
"If you want this command to fail, instead of just showing a warning,",
"You may add the 'strict_nginx' flag to common_site_config.json and set it to 1",
"\n\n")
continue
ret.append({
"name": site,
"port": site_config.get('nginx_port'),