From b70a6664f0603297bf8b20809b5a64677900b405 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 11 Oct 2012 08:23:22 +0900 Subject: add signal to end of eip checks this fixes random error on leap initialization --- src/leap/baseapp/eip.py | 4 +--- src/leap/baseapp/mainwindow.py | 3 +++ src/leap/eip/eipconnection.py | 4 ++-- src/leap/eip/openvpnconnection.py | 8 +++----- 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src/leap') diff --git a/src/leap/baseapp/eip.py b/src/leap/baseapp/eip.py index b67e4444..93dce3ac 100644 --- a/src/leap/baseapp/eip.py +++ b/src/leap/baseapp/eip.py @@ -55,9 +55,7 @@ class EIPConductorAppMixin(object): skip_verify=self.skip_verify) self.error_check() - # XXX should send ready signal instead - if self.conductor.autostart: - self.start_or_stopVPN() + self.start_eipconnection.emit() def error_check(self): """ diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index 87886767..3b6cb544 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -33,6 +33,7 @@ class LeapWindow(QtGui.QMainWindow, initReady = QtCore.pyqtSignal([]) networkError = QtCore.pyqtSignal([object]) triggerEIPError = QtCore.pyqtSignal([object]) + start_eipconnection = QtCore.pyqtSignal([]) # XXX fix nomenclature here # this is eip status change got from vpn management @@ -80,6 +81,8 @@ class LeapWindow(QtGui.QMainWindow, if self.debugmode: self.startStopButton.clicked.connect( lambda: self.start_or_stopVPN()) + self.start_eipconnection.connect( + lambda: self.start_or_stopVPN()) # status change. # TODO unify diff --git a/src/leap/eip/eipconnection.py b/src/leap/eip/eipconnection.py index bdf70f9c..fea830f3 100644 --- a/src/leap/eip/eipconnection.py +++ b/src/leap/eip/eipconnection.py @@ -84,7 +84,7 @@ class EIPConnection(OpenVPNConnection): """ entry point for connection process """ - self.forget_errors() + #self.forget_errors() self._try_connection() def disconnect(self): @@ -120,7 +120,7 @@ class EIPConnection(OpenVPNConnection): logger.warning('connection refused') return if not state: - logger.debug('no state') + #logger.debug('no state') return (ts, status_step, ok, ip, remote) = state diff --git a/src/leap/eip/openvpnconnection.py b/src/leap/eip/openvpnconnection.py index a835ead9..14839f6b 100644 --- a/src/leap/eip/openvpnconnection.py +++ b/src/leap/eip/openvpnconnection.py @@ -194,10 +194,9 @@ to be triggered for each one of them. # base class to test independently?) # - def forget_errors(self): - #print('forgetting errors') - logger.debug('forgetting errors') - self.with_errors = False + #def forget_errors(self): + #logger.debug('forgetting errors') + #self.with_errors = False def connect_to_management(self): """Connect to openvpn management interface""" @@ -216,7 +215,6 @@ to be triggered for each one of them. #self.tn.read_until('SUCCESS:', 2) self._seek_to_eof() - #self.forget_errors() return True def _seek_to_eof(self): -- cgit v1.2.3