summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/eipconfig.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-11-21 10:16:12 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-11-21 11:08:20 -0300
commitd1d724092d9eab606114dbf2aab8a9a0ad0e0e09 (patch)
treef467df2d554041102dbf602ada0d99067bba7915 /src/leap/bitmask/services/eip/eipconfig.py
parentd0a19caef10e9437b9b389764bfa50f2bb1575ac (diff)
Disable eip-config for uninitialized providers.
- Show the user which provider has not been initialized and disable its usage. - Add support for absolute path in get_eipconfig_path. - Replace hadr-coded paths with get_eipconfig_path.
Diffstat (limited to 'src/leap/bitmask/services/eip/eipconfig.py')
-rw-r--r--src/leap/bitmask/services/eip/eipconfig.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py
index 16ed4cc0..09a3d257 100644
--- a/src/leap/bitmask/services/eip/eipconfig.py
+++ b/src/leap/bitmask/services/eip/eipconfig.py
@@ -33,17 +33,25 @@ from leap.common.check import leap_assert, leap_assert_type
logger = logging.getLogger(__name__)
-def get_eipconfig_path(domain):
+def get_eipconfig_path(domain, relative=True):
"""
- Returns relative path for EIP config.
+ Returns relative or absolute path for EIP config.
:param domain: the domain to which this eipconfig belongs to.
:type domain: str
+ :param relative: defines whether the path should be relative or absolute.
+ :type relative: bool
:returns: the path
:rtype: str
"""
leap_assert(domain is not None, "get_eipconfig_path: We need a domain")
- return os.path.join("leap", "providers", domain, "eip-service.json")
+
+ path = os.path.join("leap", "providers", domain, "eip-service.json")
+
+ if not relative:
+ path = os.path.join(get_path_prefix(), path)
+
+ return path
def load_eipconfig_if_needed(provider_config, eip_config, domain):