summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2015-07-23 18:45:08 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-08-14 15:28:19 -0300
commit182dd2738f077079a47d3f56033b78dac9204986 (patch)
tree599cf5dc1dd6ba2f43e5ffae528793ba35e116dc /src/leap/bitmask/services
parentddd112e53179cbccbf852d3dd70a80cfc171a957 (diff)
[bug] handle eip-config not providing locations
Is valid for a provider not to provide locations for their gateways. - Resolves: #7281
Diffstat (limited to 'src/leap/bitmask/services')
-rw-r--r--src/leap/bitmask/services/eip/eipconfig.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py
index b1d08393..43328af9 100644
--- a/src/leap/bitmask/services/eip/eipconfig.py
+++ b/src/leap/bitmask/services/eip/eipconfig.py
@@ -161,12 +161,17 @@ class VPNGatewaySelector(object):
def get_gateways_country_code(self):
"""
Return a dict with ipaddress -> country code mapping.
+ Return None if there are no locations specified.
- :rtype: dict
+ :rtype: dict or None
"""
country_codes = {}
locations = self._eipconfig.get_locations()
+
+ if not locations:
+ return
+
gateways = self._eipconfig.get_gateways()
for idx, gateway in enumerate(gateways):