summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/eipconfig.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-12-06 16:44:32 -0300
committerTomás Touceda <chiiph@leap.se>2013-12-06 16:44:32 -0300
commit496036f15cf257d16b6594770812da64a249280c (patch)
tree3f3e13d86df06613eca22884f02c3bdb0b4e266e /src/leap/bitmask/services/eip/eipconfig.py
parentd51d6bedfecd41491f2c8243235e7d3db043a4d7 (diff)
parent5e18d4e5459595f369d94d0d5b3a280348370ebe (diff)
Merge branch 'release-0.3.8'0.3.8
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):