From 2db7202e6c3a520a5b6fe395dd74d40d8e53c481 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 1 Jun 2017 02:55:05 +0200 Subject: [refactor] hide mac/linux switch inside process module --- src/leap/bitmask/vpn/_control.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/leap/bitmask/vpn/_control.py') diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py index 8211e622..74182a9e 100644 --- a/src/leap/bitmask/vpn/_control.py +++ b/src/leap/bitmask/vpn/_control.py @@ -5,8 +5,8 @@ from twisted.internet.task import LoopingCall from twisted.internet import reactor from twisted.logger import Logger -from .process import VPNProcess, VPNCanary -from .constants import IS_LINUX, IS_MAC +from .process import VPNProcess +from .constants import IS_MAC log = Logger() @@ -57,16 +57,10 @@ class VPNControl(object): kwargs = {'openvpn_verb': 7, 'remotes': self._remotes, 'restartfun': self.restart} - if IS_LINUX: - vpnproc = VPNProcess(*args, **kwargs) - if vpnproc.get_openvpn_process(): - log.info('Another vpn process is running. Will try to stop it.') - vpnproc.stop_if_already_running() - elif IS_MAC: - # start the main vpn subprocess - vpnproc = VPNCanary(*args, **kwargs) - else: - raise Exception('This platform does not support VPN yet!') + vpnproc = VPNProcess(*args, **kwargs) + if vpnproc.get_openvpn_process(): + log.info('Another vpn process is running. Will try to stop it.') + vpnproc.stop_if_already_running() try: cmd = vpnproc.getCommand() -- cgit v1.2.3