summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/vpn.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-06-01 03:06:51 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2017-06-01 03:33:40 +0200
commit820709938e4313e04bab160115cc215769c3a1fb (patch)
tree92adb569fc1433da6f7c1bfbc3313dfbed9a8352 /src/leap/bitmask/vpn/vpn.py
parent2db7202e6c3a520a5b6fe395dd74d40d8e53c481 (diff)
[refactor] improve error reporting when openvpn not found
Diffstat (limited to 'src/leap/bitmask/vpn/vpn.py')
-rw-r--r--src/leap/bitmask/vpn/vpn.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/leap/bitmask/vpn/vpn.py b/src/leap/bitmask/vpn/vpn.py
index 677c9b91..23f0a582 100644
--- a/src/leap/bitmask/vpn/vpn.py
+++ b/src/leap/bitmask/vpn/vpn.py
@@ -44,7 +44,12 @@ class VPNManager(object):
return False
print(Fore.GREEN + "Firewall: started" + Fore.RESET)
- vpn_ok = self._vpn.start()
+ try:
+ vpn_ok = self._vpn.start()
+ except Exception:
+ self.starting = False
+ return False
+
if not vpn_ok:
print (Fore.RED + "VPN: Error starting." + Fore.RESET)
self._firewall.stop()
@@ -52,6 +57,7 @@ class VPNManager(object):
self.starting = False
return False
print(Fore.GREEN + "VPN: started" + Fore.RESET)
+ return True
def stop(self):
self.starting = False