summaryrefslogtreecommitdiff
path: root/src/leap/services
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-11 16:42:23 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-11 16:42:23 -0300
commit060984df444dbf407e9078de638ef7486ef7b0a0 (patch)
treef5b1f88240b0dc1f786341dbad2d71e14761b7d9 /src/leap/services
parent472e63ee2826f26f06233ab213d0803cd152d683 (diff)
Notify if openvpn is not found
Diffstat (limited to 'src/leap/services')
-rw-r--r--src/leap/services/eip/vpnlaunchers.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py
index cf817321..9f2967aa 100644
--- a/src/leap/services/eip/vpnlaunchers.py
+++ b/src/leap/services/eip/vpnlaunchers.py
@@ -34,6 +34,10 @@ from leap.util.check import leap_assert, leap_assert_type
logger = logging.getLogger(__name__)
+class VPNLauncherException(Exception):
+ pass
+
+
class VPNLauncher:
"""
Abstract launcher class
@@ -153,6 +157,8 @@ class LinuxVPNLauncher(VPNLauncher):
"""
Returns the platform dependant vpn launching command
+ Might raise VPNException.
+
@param eipconfig: eip configuration object
@type eipconfig: EIPConfig
@param providerconfig: provider specific configuration
@@ -174,7 +180,8 @@ class LinuxVPNLauncher(VPNLauncher):
leap_assert(socket_port, "We need a socket port!")
openvpn_possibilities = which(self.OPENVPN_BIN)
- leap_assert(len(openvpn_possibilities) > 0, "We couldn't find openvpn")
+ if len(openvpn_possibilities) == 0:
+ raise VPNLauncherException("We couldn't find openvpn")
openvpn = openvpn_possibilities[0]
args = []