diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-04-21 17:27:08 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-04-21 17:28:53 +0200 |
commit | bc07b9c8c9fdcbc9586da151016d50f33348b85e (patch) | |
tree | 60a037f6ef5e46122b0a20624f848813bd578ea2 /src/leap/bitmask/vpn/service.py | |
parent | 24c9886e032fc108488702a2f9ef1bf9702a5356 (diff) |
[bug] report global connecting state for vpn when user started
- Resolves: #8850
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r-- | src/leap/bitmask/vpn/service.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py index b04ea9f6..874c30d3 100644 --- a/src/leap/bitmask/vpn/service.py +++ b/src/leap/bitmask/vpn/service.py @@ -48,7 +48,7 @@ class VPNService(HookableService): def __init__(self, basepath=None): """ - Initialize VPN service + Initialize VPN service. This launches both the firewall and the vpn. """ super(VPNService, self).__init__() @@ -73,7 +73,10 @@ class VPNService(HookableService): @defer.inlineCallbacks def start_vpn(self, domain): - # TODO check if the VPN is started and return an error if it is. + if self._started: + exc = Exception('VPN already started') + exc.expected = True + raise exc yield self._setup(domain) try: self._vpn.start() @@ -109,6 +112,7 @@ class VPNService(HookableService): 'error': None, 'childrenStatus': {} } + if self._vpn: status = self._vpn.get_status() @@ -116,7 +120,6 @@ class VPNService(HookableService): status['domain'] = self._domain else: status['domain'] = self._read_last() - return status def do_check(self, domain=None): |