summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/launchers
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/vpn/launchers')
-rw-r--r--src/leap/bitmask/vpn/launchers/darwin.py14
-rw-r--r--src/leap/bitmask/vpn/launchers/linux.py23
-rw-r--r--src/leap/bitmask/vpn/launchers/windows.py8
3 files changed, 20 insertions, 25 deletions
diff --git a/src/leap/bitmask/vpn/launchers/darwin.py b/src/leap/bitmask/vpn/launchers/darwin.py
index f637ae1a..9ae64053 100644
--- a/src/leap/bitmask/vpn/launchers/darwin.py
+++ b/src/leap/bitmask/vpn/launchers/darwin.py
@@ -32,7 +32,7 @@ from leap.common.config import get_path_prefix
logger = Logger()
-class EIPNoTunKextLoaded(VPNLauncherException):
+class NoTunKextLoaded(VPNLauncherException):
pass
@@ -142,18 +142,18 @@ class DarwinVPNLauncher(VPNLauncher):
return kls.COCOASUDO, args
@classmethod
- def get_vpn_command(kls, eipconfig, providerconfig, socket_host,
+ def get_vpn_command(kls, vpnconfig, providerconfig, socket_host,
socket_port="unix", openvpn_verb=1):
"""
Returns the OSX implementation for the vpn launching command.
Might raise:
- EIPNoTunKextLoaded,
+ NoTunKextLoaded,
OpenVPNNotFoundException,
VPNLauncherException.
- :param eipconfig: eip configuration object
- :type eipconfig: EIPConfig
+ :param vpnconfig: vpn configuration object
+ :type vpnconfig: VPNConfig
:param providerconfig: provider specific configuration
:type providerconfig: ProviderConfig
:param socket_host: either socket path (unix) or socket IP
@@ -168,11 +168,11 @@ class DarwinVPNLauncher(VPNLauncher):
:rtype: list
"""
if not kls.is_kext_loaded():
- raise EIPNoTunKextLoaded
+ raise VPNNoTunKextLoaded
# we use `super` in order to send the class to use
command = super(DarwinVPNLauncher, kls).get_vpn_command(
- eipconfig, providerconfig, socket_host, socket_port, openvpn_verb)
+ vpnconfig, providerconfig, socket_host, socket_port, openvpn_verb)
cocoa, cargs = kls.get_cocoasudo_ovpn_cmd()
cargs.extend(command)
diff --git a/src/leap/bitmask/vpn/launchers/linux.py b/src/leap/bitmask/vpn/launchers/linux.py
index b54790f2..0c3864b2 100644
--- a/src/leap/bitmask/vpn/launchers/linux.py
+++ b/src/leap/bitmask/vpn/launchers/linux.py
@@ -38,11 +38,11 @@ COM = commands
flags_STANDALONE = False
-class EIPNoPolkitAuthAgentAvailable(VPNLauncherException):
+class NoPolkitAuthAgentAvailable(VPNLauncherException):
pass
-class EIPNoPkexecAvailable(VPNLauncherException):
+class NoPkexecAvailable(VPNLauncherException):
pass
@@ -77,19 +77,19 @@ class LinuxVPNLauncher(VPNLauncher):
OTHER_FILES = (POLKIT_PATH, BITMASK_ROOT, OPENVPN_BIN_PATH)
@classmethod
- def get_vpn_command(kls, eipconfig, providerconfig, socket_host,
+ def get_vpn_command(kls, vpnconfig, providerconfig, socket_host,
remotes, socket_port="unix", openvpn_verb=1):
"""
Returns the Linux implementation for the vpn launching command.
Might raise:
- EIPNoPkexecAvailable,
- EIPNoPolkitAuthAgentAvailable,
+ NoPkexecAvailable,
+ NoPolkitAuthAgentAvailable,
OpenVPNNotFoundException,
VPNLauncherException.
- :param eipconfig: eip configuration object
- :type eipconfig: EIPConfig
+ :param vpnconfig: vpn configuration object
+ :type vpnconfig: VPNConfig
:param providerconfig: provider specific configuration
:type providerconfig: ProviderConfig
:param socket_host: either socket path (unix) or socket IP
@@ -105,7 +105,7 @@ class LinuxVPNLauncher(VPNLauncher):
"""
# we use `super` in order to send the class to use
command = super(LinuxVPNLauncher, kls).get_vpn_command(
- eipconfig, providerconfig, socket_host, socket_port, remotes,
+ vpnconfig, providerconfig, socket_host, socket_port, remotes,
openvpn_verb)
command.insert(0, force_eval(kls.BITMASK_ROOT))
@@ -113,12 +113,7 @@ class LinuxVPNLauncher(VPNLauncher):
command.insert(2, "start")
policyChecker = LinuxPolicyChecker()
- try:
- pkexec = policyChecker.maybe_pkexec()
- except NoPolkitAuthAgentAvailable:
- raise EIPNoPolkitAuthAgentAvailable()
- except NoPkexecAvailable:
- raise EIPNoPkexecAvailable()
+ pkexec = policyChecker.maybe_pkexec()
if pkexec:
command.insert(0, first(pkexec))
diff --git a/src/leap/bitmask/vpn/launchers/windows.py b/src/leap/bitmask/vpn/launchers/windows.py
index bfaac2fc..bad01ee8 100644
--- a/src/leap/bitmask/vpn/launchers/windows.py
+++ b/src/leap/bitmask/vpn/launchers/windows.py
@@ -38,7 +38,7 @@ class WindowsVPNLauncher(VPNLauncher):
# (and maybe we won't)
@classmethod
- def get_vpn_command(kls, eipconfig, providerconfig, socket_host,
+ def get_vpn_command(kls, vpnconfig, providerconfig, socket_host,
socket_port="9876", openvpn_verb=1):
"""
Returns the Windows implementation for the vpn launching command.
@@ -47,8 +47,8 @@ class WindowsVPNLauncher(VPNLauncher):
OpenVPNNotFoundException,
VPNLauncherException.
- :param eipconfig: eip configuration object
- :type eipconfig: EIPConfig
+ :param vpnconfig: vpn configuration object
+ :type vpnconfig: VPNConfig
:param providerconfig: provider specific configuration
:type providerconfig: ProviderConfig
:param socket_host: either socket path (unix) or socket IP
@@ -68,6 +68,6 @@ class WindowsVPNLauncher(VPNLauncher):
# we use `super` in order to send the class to use
command = super(WindowsVPNLauncher, kls).get_vpn_command(
- eipconfig, providerconfig, socket_host, socket_port, openvpn_verb)
+ vpnconfig, providerconfig, socket_host, socket_port, openvpn_verb)
return command