summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-03-17 00:44:00 +0100
committerRuben Pollan <meskio@sindominio.net>2017-03-17 19:13:23 +0100
commit1d09d1a079f8ce577de13ab43c2e9add7a6247bc (patch)
treea84d324912b13b68c9990a515267f0973cf289b3 /src
parent09bf881b4f457f731c5a49e88822bc731eda2c96 (diff)
[bug] let's remove hardcoded providers
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/vpn/_status.py5
-rw-r--r--src/leap/bitmask/vpn/manager.py8
-rw-r--r--src/leap/bitmask/vpn/service.py2
-rw-r--r--src/leap/bitmask/vpn/vpn.py4
4 files changed, 10 insertions, 9 deletions
diff --git a/src/leap/bitmask/vpn/_status.py b/src/leap/bitmask/vpn/_status.py
index 7c8ff6b0..d4e8778e 100644
--- a/src/leap/bitmask/vpn/_status.py
+++ b/src/leap/bitmask/vpn/_status.py
@@ -52,8 +52,11 @@ class VPNStatus(object):
self.set_status(status, errcode)
def set_status(self, status, errcode):
- if status in ("AUTH", "WAIT"):
+ if status in ("AUTH", "WAIT", "CONNECTING", "GET_CONFIG",
+ "ASSIGN_IP", "ADD_ROUTES", "RECONNECTING"):
status = "starting"
+ elif status == "EXITING":
+ status = "stopping"
elif status == "CONNECTED":
status = "on"
diff --git a/src/leap/bitmask/vpn/manager.py b/src/leap/bitmask/vpn/manager.py
index 88d10bb7..66fc3d50 100644
--- a/src/leap/bitmask/vpn/manager.py
+++ b/src/leap/bitmask/vpn/manager.py
@@ -32,7 +32,8 @@ from .constants import IS_WIN
class TunnelManager(object):
- def __init__(self, remotes, cert_path, key_path, ca_path, extra_flags):
+ def __init__(self, provider, remotes, cert_path, key_path, ca_path,
+ extra_flags):
"""
Initialize the VPNManager object.
@@ -48,13 +49,10 @@ class TunnelManager(object):
ports = []
- # TODO fix hardcoding
- domain = "demo.bitmask.net"
-
self._remotes = remotes
self._vpnconfig = _TempVPNConfig(extra_flags, cert_path, ports)
- self._providerconfig = _TempProviderConfig(domain, ca_path)
+ self._providerconfig = _TempProviderConfig(provider, ca_path)
host, port = self._get_management_location()
self._vpn = VPNControl(remotes=remotes,
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 2c7c69ce..0a26b28c 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -150,5 +150,5 @@ class VPNService(HookableService):
cert_path = key_path = prefix + "/client/openvpn.pem"
ca_path = prefix + "/ca/cacert.pem"
- self._vpn = VPNManager(remotes, cert_path, key_path, ca_path,
+ self._vpn = VPNManager(provider, remotes, cert_path, key_path, ca_path,
extra_flags)
diff --git a/src/leap/bitmask/vpn/vpn.py b/src/leap/bitmask/vpn/vpn.py
index dc3062af..5c9e46e3 100644
--- a/src/leap/bitmask/vpn/vpn.py
+++ b/src/leap/bitmask/vpn/vpn.py
@@ -25,10 +25,10 @@ from leap.bitmask.vpn.fw.firewall import FirewallManager
class VPNManager(object):
- def __init__(self, remotes, cert, key, ca, flags):
+ def __init__(self, provider, remotes, cert, key, ca, flags):
self._vpn = TunnelManager(
- remotes, cert, key, ca, flags)
+ provider, remotes, cert, key, ca, flags)
self._firewall = FirewallManager(remotes)
def start(self):