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

pull/19/head
lalanza808 11 months ago
parent faffabceb4
commit ae45db9b5b

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

Loading…
Cancel
Save