summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/service.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-01-22 21:14:48 +0100
committerKali Kaneko <kali@leap.se>2018-01-25 01:19:18 +0100
commit7e05218519b1306a838a3fccfe342b8260af5b75 (patch)
tree4b0f859885be87f9c7ea9b79ee0740b22a8be414 /src/leap/bitmask/vpn/service.py
parent2d72f6eb4b220c8dfa3c64b2f6b82365791f0424 (diff)
[bug] several fixes after review
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r--src/leap/bitmask/vpn/service.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 0ca0f566..6d273e23 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -216,13 +216,13 @@ class VPNService(HookableService):
status['domain'] = self._read_last()
return status
- def do_check(self, domain=None):
+ def do_check(self, domain=None, timeout=1):
"""Check whether the VPN Service is properly configured,
and can be started. This returns info about the helpers being
installed, a polkit agent being present, and optionally a valid
certificate present for a domain."""
hashelpers = helpers.check()
- privcheck = helpers.privcheck(timeout=5)
+ privcheck = helpers.privcheck(timeout=1)
ret = {'installed': hashelpers, 'privcheck': privcheck}
if not privcheck:
if IS_LINUX:
@@ -323,7 +323,8 @@ class VPNService(HookableService):
key_path = cert_path
anonvpn = self._has_anonvpn(provider)
- if not os.path.isfile(cert_path):
+ ready = self.do_check(provider_id).get('vpn_ready', False)
+ if not ready:
yield self._maybe_get_anon_cert(anonvpn, provider_id)
if not os.path.isfile(ca_path):