Skip to content

Commit

Permalink
fix: setup nginx fails for broken site_config
Browse files Browse the repository at this point in the history
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
  • Loading branch information
codingCoffee committed Nov 30, 2018
1 parent b9f750f commit 8b02bed
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bench/config/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,23 @@ def get_sites_with_config(bench_path):

ret = []
for site in sites:
site_config = get_site_config(site, bench_path=bench_path)
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'),
Expand Down

0 comments on commit 8b02bed

Please sign in to comment.