diff options
author | Kali Kaneko <kali@leap.se> | 2017-08-22 16:38:13 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-08-30 16:17:56 -0400 |
commit | 49a421188febe06e66412260a828b92a543fbe99 (patch) | |
tree | d9389cface18ad2927186f9210e648711c3052a9 /src/leap/bitmask/vpn/service.py | |
parent | 46eff942e4e3b3c7ddbecd170dd7d5078b8debc0 (diff) |
[refactor] integrate new management protocol
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r-- | src/leap/bitmask/vpn/service.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py index 704bbc7..2390391 100644 --- a/src/leap/bitmask/vpn/service.py +++ b/src/leap/bitmask/vpn/service.py @@ -96,22 +96,16 @@ class VPNService(HookableService): yield self._setup(domain) - try: - fw_ok = self._firewall.start() - if not fw_ok: - raise Exception('Could not start firewall') + fw_ok = self._firewall.start() + if not fw_ok: + raise Exception('Could not start firewall') + try: vpn_ok = self._tunnel.start() - if not vpn_ok: - self._firewall.stop() - raise Exception('Could not start VPN') - - # XXX capture it inside start method - # here I'd like to get (status, message) - except NoPolkitAuthAgentAvailable as e: - e.expected = True - raise e - # -------------------------------------- + except Exception as exc: + self._firewall.stop() + # TODO get message from exception + raise Exception('Could not start VPN (reason: %r)' % exc) self._domain = domain self._write_last(domain) |