summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/_checks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/vpn/_checks.py')
-rw-r--r--src/leap/bitmask/vpn/_checks.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/leap/bitmask/vpn/_checks.py b/src/leap/bitmask/vpn/_checks.py
new file mode 100644
index 0000000..3a1914f
--- /dev/null
+++ b/src/leap/bitmask/vpn/_checks.py
@@ -0,0 +1,27 @@
+import os
+
+from leap.common.config import get_path_prefix
+
+
+class ImproperlyConfigured(Exception):
+ pass
+
+
+def is_service_ready(provider):
+ valid_cert = _has_valid_cert(provider)
+ return True
+
+
+def get_eip_cert_path(provider):
+ return os.path.join(get_path_prefix(),
+ 'leap', 'providers', provider,
+ 'keys', 'client', 'openvpn.pem')
+
+
+def _has_valid_cert(provider):
+ cert_path = get_eip_cert_path(provider)
+ has_file = os.path.isfile(cert_path)
+ if not has_file:
+ raise ImproperlyConfigured('Missing EIP certificate')
+
+