summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-08-31 10:58:59 +0200
committerRuben Pollan <meskio@sindominio.net>2017-08-31 19:21:42 +0200
commit808f9d3542e21c819beb8fe72224f000ae2e019c (patch)
tree661e9e098103658a49d4e9170128c8592464249e /src/leap/bitmask/core
parentf721c5ef0cdd9952d014a1dc9e3a944afc0f7f45 (diff)
[feat] expose an API to set/get/list gateway preferences
- Related: #9010
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/dispatcher.py14
-rw-r--r--src/leap/bitmask/core/service.py3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py
index 508a925d..363594ca 100644
--- a/src/leap/bitmask/core/dispatcher.py
+++ b/src/leap/bitmask/core/dispatcher.py
@@ -237,6 +237,20 @@ class VPNCmd(SubCommand):
d = vpn.do_list()
return d
+ @register_method('list')
+ def do_LOCATIONS(self, vpn, *parts):
+ if len(parts) > 2:
+ return vpn.do_set_locations(parts[2:])
+
+ return vpn.do_get_locations()
+
+ @register_method('list')
+ def do_COUNTRIES(self, vpn, *parts):
+ if len(parts) > 2:
+ return vpn.do_set_countries(parts[2:])
+
+ return vpn.do_get_countries()
+
class MailCmd(SubCommand):
diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py
index e823d829..026e51d9 100644
--- a/src/leap/bitmask/core/service.py
+++ b/src/leap/bitmask/core/service.py
@@ -208,7 +208,8 @@ class BitmaskBackend(configurable.ConfigurableService):
def _init_vpn(self):
if HAS_VPN:
- self._maybe_init_service('vpn', VPNService)
+ cfg = self.get_config_section('vpn')
+ self._maybe_init_service('vpn', VPNService, cfg)
def _init_zmq(self):
zs = _zmq.ZMQServerService(self)