summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-03-01 01:58:05 +0100
committerRuben Pollan <meskio@sindominio.net>2017-03-03 10:50:53 +0100
commitaf3866350e94c9238889a1c2485661466b1ec2dc (patch)
tree950511ec09ea238abb58de7ac28f2a5f19abec73 /src/leap/bitmask/core
parent4003aaaa124b1ffa77d07f7e2ae5d16e2dddacf1 (diff)
[bug] use username instead of provider in the vpn calls
Without active user we need to use the username instead of the provider in the VPN API. - Resolves: #8783
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/dispatcher.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py
index 3e50b11f..075dfd82 100644
--- a/src/leap/bitmask/core/dispatcher.py
+++ b/src/leap/bitmask/core/dispatcher.py
@@ -196,14 +196,11 @@ class VPNCmd(SubCommand):
@register_method('dict')
def do_START(self, vpn, *parts):
- # TODO --- attempt to get active provider
- # TODO or catch the exception and send error
try:
provider = parts[2]
except IndexError:
raise DispatchError(
'wrong number of arguments: expected 1, got none')
- provider = parts[2]
d = vpn.start_vpn(provider)
return d
@@ -214,14 +211,22 @@ class VPNCmd(SubCommand):
@register_method('dict')
def do_CHECK(self, vpn, *parts):
- d = vpn.do_check()
+ try:
+ provider = parts[2]
+ except IndexError:
+ raise DispatchError(
+ 'wrong number of arguments: expected 1, got none')
+ d = vpn.do_check(provider)
return d
@register_method('dict')
def do_GET_CERT(self, vpn, *parts):
- # TODO -- attempt to get active provider
- provider = parts[2]
- d = vpn.do_get_cert(provider)
+ try:
+ username = parts[2]
+ except IndexError:
+ raise DispatchError(
+ 'wrong number of arguments: expected 1, got none')
+ d = vpn.do_get_cert(username)
return d
@register_method('dict')