[fix] Do not load conf.json before overriding content.

This commit is contained in:
opi 2014-10-23 12:07:49 +02:00
parent e32ea4180a
commit b0735af6ce

7
app.py
View file

@ -924,10 +924,7 @@ def app_ssowatconf(auth):
for domain in domains: for domain in domains:
skipped_urls.extend(['/yunohost/admin', '/yunohost/api']) skipped_urls.extend(['/yunohost/admin', '/yunohost/api'])
with open('/etc/ssowat/conf.json') as f: conf_dict = {
conf_dict = json.load(f)
conf_dict.update({
'portal_domain': main_domain, 'portal_domain': main_domain,
'portal_path': '/yunohost/sso/', 'portal_path': '/yunohost/sso/',
'additional_headers': { 'additional_headers': {
@ -945,7 +942,7 @@ def app_ssowatconf(auth):
'protected_regex': protected_regex, 'protected_regex': protected_regex,
'redirected_regex': redirected_regex, 'redirected_regex': redirected_regex,
'users': users, 'users': users,
}) }
with open('/etc/ssowat/conf.json', 'w+') as f: with open('/etc/ssowat/conf.json', 'w+') as f:
json.dump(conf_dict, f, sort_keys=True, indent=4) json.dump(conf_dict, f, sort_keys=True, indent=4)