From bc07b9c8c9fdcbc9586da151016d50f33348b85e Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Fri, 21 Apr 2017 17:27:08 +0200 Subject: [bug] report global connecting state for vpn when user started - Resolves: #8850 --- src/leap/bitmask/vpn/service.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/vpn/service.py') 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): -- cgit v1.2.3