From 71c341b9aea1097e0d8f4ccc2eee9728599ea8b0 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 18 Apr 2017 22:18:16 +0200 Subject: [bug] pass along no polkit error --- src/leap/bitmask/vpn/privilege.py | 1 + src/leap/bitmask/vpn/service.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/vpn') diff --git a/src/leap/bitmask/vpn/privilege.py b/src/leap/bitmask/vpn/privilege.py index b49f165c..3c66c7a5 100644 --- a/src/leap/bitmask/vpn/privilege.py +++ b/src/leap/bitmask/vpn/privilege.py @@ -50,6 +50,7 @@ def uninstall_helpers(): class NoPolkitAuthAgentAvailable(Exception): + message = 'No polkit authentication agent available. Please run one.' pass diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py index 1ec1ed6d..eefccad1 100644 --- a/src/leap/bitmask/vpn/service.py +++ b/src/leap/bitmask/vpn/service.py @@ -29,6 +29,7 @@ from leap.bitmask.hooks import HookableService from leap.bitmask.vpn.vpn import VPNManager from leap.bitmask.vpn._checks import is_service_ready, get_vpn_cert_path from leap.bitmask.vpn import privilege, helpers +from leap.bitmask.vpn.privilege import NoPolkitAuthAgentAvailable from leap.common.config import get_path_prefix from leap.common.files import check_and_fix_urw_only from leap.common.certs import get_cert_time_boundaries @@ -68,7 +69,12 @@ class VPNService(HookableService): def start_vpn(self, domain): # TODO check if the VPN is started and return an error if it is. yield self._setup(domain) - self._vpn.start() + try: + self._vpn.start() + except NoPolkitAuthAgentAvailable as e: + e.expected = True + raise e + self._started = True self._domain = domain self._write_last(domain) -- cgit v1.2.3