From f4f2f0ff3e808bc2c85b914aa750ad68770ed334 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Wed, 3 Jun 2015 17:10:08 -0300 Subject: Creating a leap session is now part of leap init We've moved the init soledad method to the leap_initialization module and gave it a meaningful name, because it was initializing the whole leap session instead of only soledad, because of that we removed some of the uneeded config files and deduplicated some code on maintenance to use the same facilities. Some arguments had non-meaningful variable names and args was being passed everywhere (it was unclear who was using which variables in the args) We changed the initialization to pass those arguments explicitly, then we can factor them out sometime when it makes sense --- service/pixelated/maintenance.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'service/pixelated/maintenance.py') diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py index a49dc89d..2dbaf49f 100644 --- a/service/pixelated/maintenance.py +++ b/service/pixelated/maintenance.py @@ -28,12 +28,9 @@ from pixelated.config import app_factory from pixelated.config.args import parse_maintenance_args from pixelated.config.config_ua import config_user_agent from pixelated.config.dispatcher import config_dispatcher -from pixelated.config.events_server import init_events_server from pixelated.config.initialize_leap import initialize_leap -from pixelated.config.loading_page import loading from pixelated.config.register import register from pixelated.config.logging_setup import init_logging -from pixelated.config.soledad import init_soledad_and_user_key from twisted.internet import reactor, defer from twisted.internet.threads import deferToThread @@ -57,24 +54,24 @@ def initialize(): init_logging(debug=args.debug) - app = initialize_leap(args.leap_provider_cert, - args.leap_provider_cert_fingerprint, - args.config, - args.dispatcher, - args.dispatcher_stdin) + leap_session = initialize_leap( + args.leap_provider_cert, + args.leap_provider_cert_fingerprint, + args.config, + args.dispatcher, + args.dispatcher_stdin) - init_events_server() - execute_command = create_execute_command(args, app) + execute_command = create_execute_command(args, leap_session) reactor.callWhenRunning(execute_command) reactor.run() -def create_execute_command(args, app): +def create_execute_command(args, leap_session): def execute_command(): def init_soledad(): - return init_soledad_and_user_key(app, args.home) + return leap_session def get_soledad_handle(leap_session): soledad = leap_session.soledad_session.soledad -- cgit v1.2.3