summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rwxr-xr-xsrc/leap/bitmask/cli/bitmask_cli.py5
-rw-r--r--src/leap/bitmask/vpn/privilege.py3
-rw-r--r--src/leap/bitmask/vpn/service.py2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py
index 839b7f5..d34a776 100755
--- a/src/leap/bitmask/cli/bitmask_cli.py
+++ b/src/leap/bitmask/cli/bitmask_cli.py
@@ -161,9 +161,10 @@ def execute():
try:
yield cli.execute(args)
- if 'start' in sys.argv or 'restart' in sys.argv:
+ cmdline = ' '.join(sys.argv)
+ if 'ctl start' in cmdline or 'ctl restart' in cmdline:
command.default_dict_printer({'start': 'ok'})
- except Exception, e:
+ except Exception as e:
print(Fore.RED + "ERROR: " + Fore.RESET +
"%s" % str(e))
if not hasattr(e, 'expected'):
diff --git a/src/leap/bitmask/vpn/privilege.py b/src/leap/bitmask/vpn/privilege.py
index 3c66c7a..135acbb 100644
--- a/src/leap/bitmask/vpn/privilege.py
+++ b/src/leap/bitmask/vpn/privilege.py
@@ -51,11 +51,10 @@ def uninstall_helpers():
class NoPolkitAuthAgentAvailable(Exception):
message = 'No polkit authentication agent available. Please run one.'
- pass
class NoPkexecAvailable(Exception):
- pass
+ message = 'Could not find pkexec in the system'
def is_missing_policy_permissions():
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index eefccad..2766b8c 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -88,6 +88,8 @@ class VPNService(HookableService):
self._vpn.stop()
self._started = False
return {'result': 'stopped'}
+ else:
+ raise Exception('VPN was not running')
def do_status(self):
status = {