Skip to content
Snippets Groups Projects
Commit 5ea6174d authored by Nathaniel Kofalt's avatar Nathaniel Kofalt
Browse files

Fix scripting

parent a38652fe
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,8 @@ class RequestHandler(webapp2.RequestHandler):
drone_secret = self.request.headers.get('X-SciTran-Auth', None)
site_id = config.site_id()
# FIXME: another crash on master
# if site_id is None:
# self.abort(503, 'Database not initialized')
if site_id is None:
self.abort(503, 'Database not initialized')
# User (oAuth) authentication
if access_token and self.app.config['oauth2_id_endpoint']:
......
......@@ -22,7 +22,6 @@ ap.add_argument('--central_uri', help='scitran central api', default='https://sd
ap.add_argument('--log_level', help='log level [info]', default='info')
ap.add_argument('--drone_secret', help='shared drone secret')
# REVIEW: remove most above flags?
ap.add_argument('--config', help='path to config file')
if __name__ == '__main__':
......@@ -45,9 +44,13 @@ if args.config:
if mongo_uri:
args.db_uri = 'mongodb://' + mongo_uri
central_url = mapping.get('central', {}).get('url', None)
if central_url:
args.central_uri = central_url
if mapping.get('central', {}).get('registered', False):
central_url = mapping.get('central', {}).get('url', None)
if central_url:
args.central_uri = central_url
else:
# Manually disable central if toml was provided and config did not explicitly enable
args.central_uri = None
auth_id_endpoint = mapping.get('auth', {}).get('id_endpoint', None)
if auth_id_endpoint:
......@@ -97,9 +100,6 @@ if not api.app.config['drone_secret']:
if not os.path.exists(api.app.config['data_path']):
os.makedirs(api.app.config['data_path'])
# FIXME hard-coded off to fix crash at @gsfr's direction
centralclient_enabled = False
# FIXME All code shoud use the mongo module and this line should be deleted.
api.app.db = mongo.db
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment