Commit 27a7896b authored by Joanne Hugé's avatar Joanne Hugé

geoip2: handle IPs without country information

For instance 89.30.119.100 has an entry in the geoip2 database without country
key
parent df8f8320
...@@ -236,7 +236,7 @@ class BaseTunnelManager(object): ...@@ -236,7 +236,7 @@ class BaseTunnelManager(object):
def geoiplookup(ip): def geoiplookup(ip):
try: try:
return country(ip).country.iso_code.encode() return country(ip).country.iso_code.encode()
except errors.AddressNotFoundError: except Exception:
return return
self._geoiplookup = geoiplookup self._geoiplookup = geoiplookup
if cache.same_country: if cache.same_country:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment