summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/service.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-06-02 12:33:26 +0200
committerRuben Pollan <meskio@sindominio.net>2017-06-05 20:56:28 +0200
commit4d7380dd1e868aceeebc64ed5fc1d24369999fa9 (patch)
tree8cb479b025378ec4b2b76a078a562c8aad7dcf91 /src/leap/bitmask/vpn/service.py
parentbc7dd3e575fcd5ed6ee6aa352c97741f761130aa (diff)
[feat] On bitmaskclt vpn start use the last vpn if no provider is provided
- Resolves: #8835
Diffstat (limited to 'src/leap/bitmask/vpn/service.py')
-rw-r--r--src/leap/bitmask/vpn/service.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 5ab1e97e..6586a4fe 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -72,11 +72,18 @@ class VPNService(HookableService):
super(VPNService, self).stopService()
@defer.inlineCallbacks
- def start_vpn(self, domain):
+ def start_vpn(self, domain=None):
if self._started:
exc = Exception('VPN already started')
exc.expected = True
raise exc
+ if not domain:
+ domain = self._read_last()
+ if not domain:
+ exc = Exception("VPN can't start, a provider is need")
+ exc.expected = True
+ raise exc
+
yield self._setup(domain)
try: