[bug] eip_can_start should return false if provider does not support eip
authorelijah <elijah@riseup.net>
Thu, 14 Apr 2016 19:39:26 +0000 (12:39 -0700)
committerKali Kaneko <kali@leap.se>
Fri, 15 Apr 2016 19:17:58 +0000 (15:17 -0400)
otherwise, it tries to open eip config.

- Resolves: #7538
- Releases: 0.9.2

src/leap/bitmask/backend/components.py

index bc34c84..03a92c8 100644 (file)
@@ -44,7 +44,7 @@ from leap.bitmask.platform_init import IS_LINUX
 from leap.bitmask import pix
 from leap.bitmask.provider.pinned import PinnedProviders
 from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper
-from leap.bitmask.services import get_supported
+from leap.bitmask.services import get_supported, EIP_SERVICE
 from leap.bitmask.services.eip import eipconfig
 from leap.bitmask.services.eip import get_openvpn_management
 from leap.bitmask.services.eip.eipbootstrapper import EIPBootstrapper
@@ -651,8 +651,10 @@ class EIP(object):
             logger.error("No polkit agent running.")
             return False
 
-        eip_config = eipconfig.EIPConfig()
         provider_config = ProviderConfig.get_provider_config(domain)
+        if EIP_SERVICE not in provider_config.get_services():
+            return False
+        eip_config = eipconfig.EIPConfig()
 
         api_version = provider_config.get_api_version()
         eip_config.set_api_version(api_version)