[ci skip] fix assumption of 'en' in response

pull/19/head
lalanza808 1 year ago
parent faffabceb4
commit ae45db9b5b

@ -37,13 +37,14 @@ def nodes():
geo = get_geoip(host)
geostr = 'geoip{{latitude="{lat}", longitude="{lon}", country_code="{country_code}", country_name="{country_name}", status="{status}"}} 1'
if geostr not in peers:
peers.append(geostr.format(
lat=geo.location.latitude,
lon=geo.location.longitude,
country_code=geo.continent.code,
country_name=geo.continent.names['en'],
status=status
))
if 'en' in geo.continent.names:
peers.append(geostr.format(
lat=geo.location.latitude,
lon=geo.location.longitude,
country_code=geo.continent.code,
country_name=geo.continent.names['en'],
status=status
))
for peer in peer_list['gray_list']:
if peer.get('host'):
add_peer(peer['host'], 'gray')

Loading…
Cancel
Save