diff options
author | kali <kali@leap.se> | 2012-08-08 07:01:27 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-08 07:01:27 +0900 |
commit | e81ddf7648e1075a15d8add11cd975a73aa09926 (patch) | |
tree | 7c0c835486e3e52ccd83b80c9c1e17fb7725d0a9 /src | |
parent | 530e10214a6f018909714b288d997df13ab4f9df (diff) |
catch missing keyfile error
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/baseapp/mainwindow.py | 13 | ||||
-rw-r--r-- | src/leap/eip/conductor.py | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index cbdd2d07..c54eb97f 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -79,6 +79,19 @@ class LeapWindow(QMainWindow): status_signals=(self.statusChange.emit, ), debug=self.debugmode) + # bunch of self checks. + # XXX move somewhere else alltogether. + + if self.conductor.missing_vpn_keyfile is True: + dialog = ErrorDialog() + dialog.criticalMessage( + 'Could not find the vpn keys file', + 'error') + + # ... btw, review pending. + # os.kill of subprocess fails if we have + # some of this errors. + if self.conductor.bad_keyfile_perms is True: dialog = ErrorDialog() dialog.criticalMessage( diff --git a/src/leap/eip/conductor.py b/src/leap/eip/conductor.py index 3f40f068..11b0358c 100644 --- a/src/leap/eip/conductor.py +++ b/src/leap/eip/conductor.py @@ -14,6 +14,7 @@ from leap.eip.config import (get_config, build_ovpn_command, check_vpn_keys, EIPNoPkexecAvailable, EIPNoPolkitAuthAgentAvailable, + EIPInitNoKeyFileError, EIPInitBadKeyFilePermError) from leap.eip.vpnwatcher import EIPConnectionStatus, status_watcher from leap.eip.vpnmanager import OpenVPNManager, ConnectionRefusedError @@ -101,6 +102,7 @@ to be triggered for each one of them. self.missing_pkexec = False self.missing_auth_agent = False self.bad_keyfile_perms = False + self.missing_vpn_keyfile = False self.command = None self.args = None @@ -181,6 +183,8 @@ to be triggered for each one of them. """ try: check_vpn_keys(self.config) + except EIPInitNoKeyFileError: + self.missing_vpn_keyfile = True except EIPInitBadKeyFilePermError: logger.error('error while checking vpn keys') self.bad_keyfile_perms = True |