From 6135732761c2e64408c7615eac691c3a44b83faa Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 1 Aug 2013 21:44:05 +0200 Subject: update comments --- src/leap/gui/mainwindow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 2325ecf0..bf959d05 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -887,7 +887,6 @@ class MainWindow(QtGui.QMainWindow): self.ui.stackedWidget.setCurrentIndex(self.EIP_STATUS_INDEX) - # XXX disabling soledad for now self._soledad_bootstrapper.run_soledad_setup_checks( self._provider_config, self._login_widget.get_user(), @@ -908,7 +907,9 @@ class MainWindow(QtGui.QMainWindow): """ passed = data[self._soledad_bootstrapper.PASSED_KEY] if not passed: - # TODO: display in the GUI + # TODO: display in the GUI: + # should pass signal to a slot in status_panel + # that sets the global status logger.error("Soledad failed to start: %s" % (data[self._soledad_bootstrapper.ERROR_KEY],)) -- cgit v1.2.3 From 90c932e44173acddb61e358fd34d36422dca9cde Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 1 Aug 2013 21:45:03 +0200 Subject: fix for none --- src/leap/services/soledad/soledadbootstrapper.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/leap/services/soledad/soledadbootstrapper.py b/src/leap/services/soledad/soledadbootstrapper.py index ac063152..208ad34c 100644 --- a/src/leap/services/soledad/soledadbootstrapper.py +++ b/src/leap/services/soledad/soledadbootstrapper.py @@ -89,11 +89,12 @@ class SoledadBootstrapper(AbstractBootstrapper): # TODO: Select server based on timezone (issue #3308) server_dict = self._soledad_config.get_hosts() - if len(server_dict.keys() > 0): + if server_dict.keys(): selected_server = server_dict[server_dict.keys()[0]] - server_url = "https://%s:%s/user-%s" % (selected_server["hostname"], - selected_server["port"], - uuid) + server_url = "https://%s:%s/user-%s" % ( + selected_server["hostname"], + selected_server["port"], + uuid) logger.debug("Using soledad server url: %s" % (server_url,)) -- cgit v1.2.3 From 11294fe5b7de8149bc3beee6812ad045c78ee469 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 1 Aug 2013 21:45:28 +0200 Subject: reduce indentation --- src/leap/services/soledad/soledadbootstrapper.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/leap/services/soledad/soledadbootstrapper.py b/src/leap/services/soledad/soledadbootstrapper.py index 208ad34c..e3ccc7fb 100644 --- a/src/leap/services/soledad/soledadbootstrapper.py +++ b/src/leap/services/soledad/soledadbootstrapper.py @@ -128,12 +128,12 @@ class SoledadBootstrapper(AbstractBootstrapper): self._soledad_config = SoledadConfig() headers = {} - mtime = get_mtime(os.path.join(self._soledad_config - .get_path_prefix(), - "leap", - "providers", - self._provider_config.get_domain(), - "soledad-service.json")) + mtime = get_mtime( + os.path.join( + self._soledad_config.get_path_prefix(), + "leap", "providers", + self._provider_config.get_domain(), + "soledad-service.json")) if self._download_if_needed and mtime: headers['if-modified-since'] = mtime @@ -160,10 +160,11 @@ class SoledadBootstrapper(AbstractBootstrapper): # Not modified if res.status_code == 304: logger.debug("Soledad definition has not been modified") - self._soledad_config.load(os.path.join("leap", - "providers", - self._provider_config.get_domain(), - "soledad-service.json")) + self._soledad_config.load( + os.path.join( + "leap", "providers", + self._provider_config.get_domain(), + "soledad-service.json")) else: soledad_definition, mtime = get_content(res) -- cgit v1.2.3 From 4028fc6be007d32209db8657809539d1e110302d Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 2 Aug 2013 11:10:01 +0200 Subject: Properly shutdown soledad instance. --- src/leap/gui/mainwindow.py | 12 ++++++++++-- src/leap/services/soledad/soledadbootstrapper.py | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index bf959d05..ed0d4652 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -910,8 +910,8 @@ class MainWindow(QtGui.QMainWindow): # TODO: display in the GUI: # should pass signal to a slot in status_panel # that sets the global status - logger.error("Soledad failed to start: %s" % - (data[self._soledad_bootstrapper.ERROR_KEY],)) + logger.warning("Soledad failed to start: %s" % + (data[self._soledad_bootstrapper.ERROR_KEY],)) def _soledad_bootstrapped_stage(self, data): """ @@ -1381,8 +1381,15 @@ class MainWindow(QtGui.QMainWindow): if self._srp_auth is not None: if self._srp_auth.get_session_id() is not None or \ self._srp_auth.get_token() is not None: + # XXX this can timeout after loong time: See #3368 self._srp_auth.logout() + if self._soledad: + logger.debug("Closing soledad...") + self._soledad.close() + else: + logger.error("No instance of soledad was found.") + logger.debug('Cleaning pidfiles') self._cleanup_pidfiles() @@ -1396,6 +1403,7 @@ class MainWindow(QtGui.QMainWindow): self._cleanup_and_quit() self._really_quit = True + if self._wizard: self._wizard.close() diff --git a/src/leap/services/soledad/soledadbootstrapper.py b/src/leap/services/soledad/soledadbootstrapper.py index e3ccc7fb..f14e9e50 100644 --- a/src/leap/services/soledad/soledadbootstrapper.py +++ b/src/leap/services/soledad/soledadbootstrapper.py @@ -62,6 +62,7 @@ class SoledadBootstrapper(AbstractBootstrapper): self._download_if_needed = False self._user = "" self._password = "" + self._soledad = None @property def keymanager(self): @@ -193,7 +194,7 @@ class SoledadBootstrapper(AbstractBootstrapper): address, "https://%s:6425" % (self._provider_config.get_domain()), self._soledad, - #token=srp_auth.get_token(), # TODO: enable token usage + #token=srp_auth.get_token(), # TODO: enable token usage session_id=srp_auth.get_session_id(), ca_cert_path=self._provider_config.get_ca_cert_path(), api_uri=self._provider_config.get_api_uri(), -- cgit v1.2.3