summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/vpnprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/services/eip/vpnprocess.py')
-rw-r--r--src/leap/bitmask/services/eip/vpnprocess.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py
index 6d18a599..de8d92f3 100644
--- a/src/leap/bitmask/services/eip/vpnprocess.py
+++ b/src/leap/bitmask/services/eip/vpnprocess.py
@@ -175,7 +175,8 @@ class VPN(object):
:param kwargs: kwargs to be passed to the VPNProcess
:type kwargs: dict
"""
- logger.debug('VPN: start ---------------------------------------------------')
+ logger.debug(
+ 'VPN: start ---------------------------------------------------')
self._user_stopped = False
self._stop_pollers()
kwargs['openvpn_verb'] = self._openvpn_verb
@@ -183,7 +184,6 @@ class VPN(object):
restart = kwargs.pop('restart', False)
-
# FIXME it would be good to document where the
# errors here are catched, since we currently handle them
# at the frontend layer. This *should* move to be handled entirely
@@ -206,7 +206,8 @@ class VPN(object):
cmd = vpnproc.getCommand()
if vpnproc.get_openvpn_process():
- logger.info("Another vpn process is running. Will try to stop it.")
+ logger.info(
+ "Another vpn process is running. Will try to stop it.")
vpnproc.stop_if_already_running()
# we try to bring the firewall up
@@ -245,8 +246,6 @@ class VPN(object):
running_proc = reactor.spawnProcess(vpnproc, cmd[0], cmd, env)
vpnproc.pid = running_proc.pid
self._vpnproc = vpnproc
-
-
# add pollers for status and state
# this could be extended to a collection of
@@ -292,7 +291,8 @@ class VPN(object):
:rtype: bool
"""
if IS_LINUX:
- BM_ROOT = force_eval(linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
+ BM_ROOT = force_eval(
+ linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
fw_up_cmd = "pkexec {0} firewall isup".format(BM_ROOT)
fw_is_down = lambda: commands.getstatusoutput(fw_up_cmd)[0] == 256
return fw_is_down()
@@ -303,7 +303,6 @@ class VPN(object):
result = helper.send(cmd)
return True
-
def tear_down_firewall(self):
"""
Tear the firewall down using the privileged wrapper.
@@ -315,7 +314,8 @@ class VPN(object):
return True
if IS_LINUX:
- BM_ROOT = force_eval(linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
+ BM_ROOT = force_eval(
+ linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
exitCode = subprocess.call(["pkexec",
BM_ROOT, "firewall", "stop"])
return True if exitCode is 0 else False
@@ -331,7 +331,8 @@ class VPN(object):
return True
if IS_LINUX:
- BM_ROOT = force_eval(linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
+ BM_ROOT = force_eval(
+ linuxvpnlauncher.LinuxVPNLauncher.BITMASK_ROOT)
exitCode = subprocess.call(["pkexec",
BM_ROOT, "openvpn", "stop"])
return True if exitCode is 0 else False