Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1582)

Unified Diff: appengine/auth_service/handlers_frontend.py

Issue 1148073005: Use luci-config for infrequently changing settings, part 2. (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: fix pylint (??!) Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/auth_service/config.py ('k') | appengine/auth_service/handlers_frontend_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/auth_service/handlers_frontend.py
diff --git a/appengine/auth_service/handlers_frontend.py b/appengine/auth_service/handlers_frontend.py
index 1ea9bb77da1b0c0848098c1b5b48a52478dc1bc3..6c7bde5745df3eed9d8c40b6932870447a19a020 100644
--- a/appengine/auth_service/handlers_frontend.py
+++ b/appengine/auth_service/handlers_frontend.py
@@ -94,16 +94,16 @@ class ImporterConfigHandler(auth.ApiHandler):
@auth.require(auth.is_admin)
def get(self):
- self.send_response({'config': importer.read_config()})
+ self.send_response({'config': importer.read_config_text()})
@auth.require(auth.is_admin)
def post(self):
if config.is_remote_configured():
self.abort_with_error(409, text='The configuration is managed elsewhere')
- conf = self.parse_body().get('config')
- if not importer.is_valid_config(conf):
- self.abort_with_error(400, text='Invalid config format.')
- importer.write_config(conf)
+ try:
+ importer.write_config_text(self.parse_body().get('config'))
+ except ValueError as ex:
+ self.abort_with_error(400, text=str(ex))
self.send_response({'ok': True})
« no previous file with comments | « appengine/auth_service/config.py ('k') | appengine/auth_service/handlers_frontend_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698